Re: drop down selection box




"J.O. Aho" <user@xxxxxxxxxxx> wrote in message
news:5528qpF22eoo4U1@xxxxxxxxxxxxxxxxxxxxx
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>
writing in news:yJCdncQCD-_83nbYRVnytAA@xxxxxxxxxxxxxx:

"Adrienne Boswell" <arbpen@xxxxxxxxx> wrote in message
news:Xns98E98C758EC32arbpenyahoocom@xxxxxxxxxxxxxxxx
Gazing into my crystal ball I observed "the red dot" <red@xxxxxxxx>
writing in news:SoWdnZ3qus8etnbYnZ2dnUVZ8s-qnZ2d@xxxxxxxxxxxxxx:

this is driving me crazy but i am trying to find some examples of a
drop
down selection box with a go button that doesnt use javascript...
is
this
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:

im attempting to find a way to do it without javascript
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
Yup, I see what you mean. Can you do it server side, and not be
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.


ahh i seem to remember seeing that on my google travels but couldnt
quite
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.

--

crikey, cheers mate, i'll have a look at this properly later...


.


Loading