Click to See Complete Forum and Search --> : problems with selection box


mohvmark
08-13-2008, 07:33 PM
print "<form name=x".$todo_id ." action=functions.php method=post target='_blank'>
<select name='option' onChange='document.x".$todo_id .".submit();'>
<option>------Choose------</option>
<option value='1'>Change Status</option>
<option value='2'>Edit</option>
<option value='3'>Insert Reminder</option>
<option value='4'>Add Contact</option>
</select></TD><TD><input type=hidden name=todo_id value=".$info['todo_id'] .">
</FORM>";


I want the the <option>------Choose------</option>
to NOT open a freakin window.. :queasy:

Anyone?

dagon
08-13-2008, 09:34 PM
then take out the target, this is an html issue not a php one

mohvmark
08-13-2008, 09:37 PM
I know so.. but I didnt know where to put it. It concerns every phpuser thou. :)
Target must be set to _blank.

dagon
08-13-2008, 10:00 PM
Target must be set to _blank.

then you will always get a new window

formlesstree4
08-13-2008, 11:59 PM
it's _self

Krik
08-14-2008, 03:50 AM
Just off the top of my head head here wouldn't an onClick on each option do what is needed.

And if you want it in the same window there is no need to set target. In fact I hardly ever see a form with that set in it. Usually if theywish the form to open a new window or submit to another window they use javascript. But whatever I guess it works.

bradgrafelman
08-14-2008, 07:34 PM
Moved to ClientSide Technologies (issue isn't PHP-releated, as mentioned).

As for your problem, something like this should work:

<select name="option" onChange="if(this.value != '')document.x123.submit();">
<option value="">------Choose------</option>
<!-- other options here -->
</select>