xSDMx 0 Newbie Poster

Hello, I'm not sure exactly how to do this, but I was wondering if someone could help me out. I have variable $z, and it sets the number of poll options (fields) available ($z was originally a database item set by the administrator). Instead of having $z set by the admin, how could I go about having the $z variable changed by the user (when posting) via a drop down box, without submitting the page (using onChange and javascript)? And, what would the html look like for the drop down box?

Here's what I'm working with:

if ($ptype == 1) 
{
?>
<legend><?php echo $lang_polls['New poll legend'] ?></legend>
<div class="infldset">
<input type="hidden" name="ptype" value="1" />
<label><strong><?php echo $lang_polls['Question'] ?></strong><br /><input class="textbox" type="text" name="req_question" value="<?php if (isset($_POST['req_question'])) echo pun_htmlspecialchars($question); ?>" size="50" maxlength="50" tabindex="<?php echo $cur_index++ ?>" /><br /><br /></label>
<?php
$z = "15";
for ($x = 1; $x <= $z ;$x++) 
{
?>
<label><strong><?php echo $lang_polls['Option'] ?></strong><br /> <input class="textbox" type="text" name="poll_option[<?php echo $x; ?>]" value="<?php if (isset($_POST['poll_option'][$x])) echo pun_htmlspecialchars($option[$x]); ?>" size="40" maxlength="40" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
<?php
} 
?></div></fieldset></div><?php   
}