This will generate the required URL pattern:
http://www.comics.com/04/05/page.htm
This will not submit the form however, so the destination page will not be
able to read any POST/GET form variables.
The call to the javascript can be placed in the form tag as an onSubmit
event, or on a button in the form as an onClick event.
<script type="text/javascript">
function ProcessForm(dom ain,page)
{
var formObject=docu ment.forms['myform'];
var Select1Object=f ormObject.eleme nts['select1'];
var Select1Object=f ormObject.eleme nts['select2'];
var Select1Value=Se lect1Object.opt ions[Select1Object.s electedIndex].value;
var Select2Value=Se lect2Object.opt ions[Select2Object.s electedIndex].value;
if(Select1Value =='null')
{
return false;
}
if(Select2Value =='null')
{
return false;
}
window.location .href='http://'+domain'/'+Select1Value+ '/'+Select2Value+ '/'+p
age;
}
</script>
....
<form name="myform" action="#"
onSubmit="Proce ssForm('www.com ics.com','page. htm'); return false;">
<select name="select1">
<option value="null">Se lect day</option>
<option value="01">1</option>
....
<option value="31">31</option>
</select>
<select name="select2">
<option value="null">Se lect month</option>
<option value="01">Janu ary</option>
....
<option value="12">Dece mber</option>
</select>
<input type="submit" value="Go">
<input type="button" value="Go"
onClick="Proces sForm('www.comi cs.com','page.h tm'); return false;">
</form>
"Jared" <ja************ **@iqpc.co.uk> wrote in message
news:47******** *************** ***@posting.goo gle.com...
Hi there
I am trying to do the following with no luck:
I want to have a form with two select menus. Each menu will obvisouly
have different options, each with its own value. Then quite simply,
when the user clicks on the submit button, I want the resulting URL to
include options from the select fields ( ie: whatever the user has
selected.)
For eg: for a date URL, the final URL might be:
'http://www.comics.com/' +day+ '/' +month+ '/garfield.gif'
Do you just want to generate the above URL pattern, or do you want to submit
the form variables (day, month) as well?
Hope this makes sense, and appreciate any assistance.
Thanks,
Jared