RE: [PHP] select option and php

From: Date: Mon, 24 Jul 2006 12:01:43 +0000
Subject: RE: [PHP] select option and php
Groups: php.general 
Request: Send a blank email to php-general+get-239723@lists.php.net to get a copy of this message
[snip] It will produce the html tag as shown below: <script language="JavaScript"> function gotoPage(){ var urlpath = "../listflag.php?start=&pageID="+3; document.forms['listfrm'].method = 'post'; document.forms['listfrm'].action = urlpath; document.forms['listfrm'].submit; } </script> <form name="listfrm"> Go to Page:<select name="pageid" class="inputfield" onchange="javascript:gotoPage()"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </form> I tried using onchange in the select tag,but it did not work. It go to the javascript but the form is not submitted . Anyideas why? [/snip] In gotoPage() you're not referencing the value of pageid (document.forms['listfrm'].pageid.value). More of a JavaScript question, are you a member of a JavaScript list?

« previous php.general (#239723) next »