Automatic Redirection from Drop down box

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Mh_0
New php-forum User
New php-forum User
Posts: 11
Joined: Thu Nov 14, 2002 7:13 am
Location: UK
Contact:

Automatic Redirection from Drop down box

Postby Mh_0 » Fri Feb 14, 2003 5:27 am

When an item is seleted in a drop down box, I need the page to call itself, and using my current code it doesn't, what have I done wrong?

<form NAME="resnav" ACTION="bevel2.php" METHOD="post" style="margin-bottom:0;">
<td>
<select name="select" onChange="<? PHP_SELF; ?>">
<option value="" SELECTED>UKORS</option>
<option value="">---------------------------</option>
<option value="ab">About</option>
<option value="nm>">NMEP</option>
<option value="http://www.soc.soton.ac.uk/OED/CruisePlan>">Cruise
Planning</option>
<option value="fa>">Facilities</option>
</select>
</td>
</form>

Obviously this form is in a table

Thanks in advance

Ps you can see the site at http://www.soc.soton.ac.uk/OED/NewWeb

User avatar
pootergeist
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK
Contact:

Postby pootergeist » Fri Feb 14, 2003 6:15 am

onchange="document.location.replace('<?=$_SERVER['REQUEST_URI'];?>');"

User avatar
pootergeist
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK
Contact:

Postby pootergeist » Fri Feb 14, 2003 6:19 am

note: that obviously wouldn't effect a POST of any of the form variables as it only refreshes the page.
If you were hoping to access the value of the selected item on the newly refreshed page, you would need to effect a form submit rather than page refresh

onchange="document.forms['resnav'].action = <?=$_SERVER['REQUEST_URI'];?>; document.forms['resnav'].submit();"


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest