|
|
 |
|
|
Pages: 1
onchange i </select>
(Click here to view the original thread with full colors/images)
Posted by: dortique
Hi there!
I need to reload my document when a select changes. I wrote this code, which works:
echo '<form enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'" method="get" name="formen">';
echo '<select name="sizeset" size="1" onchange="formen.submit()" selected="0">';
echo '<option value="hut">Hut</option>';
echo '<option value="dut">Dut</option>';
echo '<option value="sut">Sut</option>';
echo '<option value="mut">Mut</option>';
echo '<option value="lut">Lut</option>';
echo '</select>';
echo '<br>';
echo '</form>'
So far so good.
Now I would also like to have a button, so just before the last line (</form>) I add
ehco '</input name="button" type="submit" value="submit">
Now I can only reload the page via the button, the select-box's onchange never triggers.
What's up with that??
Thanx in Advance
Dortique
Posted by: illuminati
Try taking the submit button out side the form close tag and add the onclick to a button instead of a submit type button.
echo '<select name="sizeset" size="1" onchange="formen.submit()" selected="0">';
echo '<option value="hut">Hut</option>';
echo '<option value="dut">Dut</option>';
echo '<option value="sut">Sut</option>';
echo '<option value="mut">Mut</option>';
echo '<option value="lut">Lut</option>';
echo '</select>';
echo '<br>';
</form>
<input type=button onclick="formen.submit()">
Posted by: dortique
Works like a charm - thanx a bundle :-)
|
|
|
|
|