Re: drop down selection box
- From: "J.O. Aho" <user@xxxxxxxxxxx>
- Date: Mon, 05 Mar 2007 11:13:45 +0100
the red dot wrote:
"Adrienne Boswell" <arbpen@xxxxxxxxx> wrote in message
news:Xns98E9CB0427D47arbpenyahoocom@xxxxxxxxxxxxxxxx
Gazing into my crystal ball I observed "the red dot" <red@xxxxxxxx>ahh i seem to remember seeing that on my google travels but couldnt quite
writing in news:yJCdncQCD-_83nbYRVnytAA@xxxxxxxxxxxxxx:
"Adrienne Boswell" <arbpen@xxxxxxxxx> wrote in messageYup, I see what you mean. Can you do it server side, and not be
news:Xns98E98C758EC32arbpenyahoocom@xxxxxxxxxxxxxxxx
Gazing into my crystal ball I observed "the red dot" <red@xxxxxxxx>im attempting to find a way to do it without javascript
writing in news:SoWdnZ3qus8etnbYnZ2dnUVZ8s-qnZ2d@xxxxxxxxxxxxxx:
this is driving me crazy but i am trying to find some examples of adropdown selection box with a go button that doesnt use javascript...this
is
possible or am i barking up a very wrong tree?What's wrong with plain links? What about users without javascript
(Google comes to mind)? How about:
plain links will mess up design/layout especially as the film titles
are a bit long in some case so if a user increases the font size too
much the whole thing will go mad
dependent on js at all?
<form method="post" action="<?php_self?>"
<fieldset>
<legend>Choose a Film</legend>
<label for="film">Title: </label>
<select name="film" id="film" onchange="this.form.submit();">
<option value="#"></option>
<option value="#">Fighting the Taliban</option>
<option value="#">Meeting the Taliban</option>
<option value="php/afghan.php">Afghan Ladies' Driving School</option>
</select>
<input type="submit" "value="GO" />
</fieldset>
</form>
This will work for js browsers and non-jsbrowsers. Just put a little
php at the top looking for what the script submitted, and redirect from
there.
get my head around it, is it possible for you to post the link (if you have
it) so i can go and have another (deeper) investigation, what do you mean by
put a little php at the top? as usual the more i know the less i seem to
understand.
You must use a redirect page specially if you want to use anchors in the same page.
In your html pages:
<form method="post" action="redirect.php"
<fieldset>
<legend>Choose a Film</legend>
<label for="film">Title: </label>
<select name="film" id="film" onchange="this.form.submit();">
<option value="#"></option>
<option value="#">Fighting the Taliban</option>
<option value="#">Meeting the Taliban</option>
<option value="php/afghan.php">Afghan Ladies' Driving School</option>
</select>
<noscript><input type="submit" "value="GO" /></noscript>
</fieldset>
</form>
I assume the "this.form.submit()" works when the javascript is enabled, then in theory you wouldn't need the submit button, so set it inside noscript tags that should enable the button for none javascripters (may not work n old browsers like mosaic).
--- redirect.php ---
<?PHP
switch($_REQUEST['film']) {
case 'taliban':
header('Location: http://www.example.net/pagename.html');
exit;
case 'driver':
header('Location: http://www.example.net/afghan.html');
exit;
case '#hello':
/* not sure if this works */
header('Location: http://www.example.net/afghan.html#hello');
exit;
default:
header('Location: http://www.example.net');
exit;
}
?>
--- eof ---
Using a redirect script makes you need only one server side script instead of making all your pages to server side scripts.
--
//Aho
.
- Follow-Ups:
- Re: drop down selection box
- From: the red dot
- Re: drop down selection box
- References:
- drop down selection box
- From: the red dot
- Re: drop down selection box
- From: the red dot
- Re: drop down selection box
- From: the red dot
- drop down selection box
- Prev by Date: Re: drop down selection box
- Next by Date: Re: drop down selection box
- Previous by thread: Re: drop down selection box
- Next by thread: Re: drop down selection box
- Index(es):
Relevant Pages
|