View Full Version : FAcing difficulty in retreiving a selected option value.

12-15-2009, 01:29 PM
I am using following code--

<select id=\"extenddays\" size=\"1\" name=\"extenddays\">
<option value\=\"2\"> 2 </option>
<option value\=\"4\"> 4 </option>
<option value\=\"7\"> 7 </option>
<a href=?ext_days=\"extendform.extenddays.value\" & ?extfid=" . $data->{'fid'} ." \" >
<INPUT TYPE=\"SUBMIT\" NAME=\"extend\" VALUE=\"extend\" />

Here, I want that when I click on 'extend' button, it should redirect to the url given in the href.. But while forming url run time , it is not retrieving the value of "extenddays" ( which is selected option value)..

Please help.

Shashikant Shinde

12-15-2009, 01:38 PM
You can't insert bits of javascript inline like that. That value is literally 'extendform.extenddays.value', not 'whatever the value is'.

You have to change it later, like


12-15-2009, 02:30 PM
For the beginning: What's the use of those backslashes? \

<select id=\"extenddays\" size=\"1\" name=\"extenddays\">

12-15-2009, 02:36 PM
The OP doesn't make it clear, but I gather it's within a PHP echo.

12-15-2009, 02:46 PM
shashishinde, post the HTML generated code, not the PHP nor ASP nor whiechever server-side language code. JavaScript interacts only with the HTML elements. We need to see them.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum