Well, if javascript is enabled you can use the above example, but if javascript is disabled you can display a regular form, like this:
<script language="javascript">
<!--
document.write('<select onchange="form.submit()">'
document.write('<option>yo
document.write('<option>yo
document.write('</select>'
//-->
</script>
<noscript>
<form method="post">
<select name="selectmenu">
<option>youroption1</optio
<option>youroption2</optio
</select>
<input type="submit">
</form>
</noscript>
This would display a form without a submit button if javascript is enabled, but if javascript is disabled, it would display a form with a submit button.
Main Topics
Browse All Topics





by: pinaldavePosted on 2005-08-30 at 06:44:37ID: 14784334
<select onchange="form.submit()"> n> n>
<option>youroption1</optio
<option>youroption2</optio
</select>
This will submit the form where the select element is.
As you know you do not want to use submit button. That makes it that you want to use JS to submit the button. If JS is disabled this will not work. Though, your client are requesting it so if they have disabled JS they will have to enabled it. Though usually it is enabled.
Regards,
---Pinal