Forum Moderators: phranque

Message Too Old, No Replies

simple way to append via form

adding to url

         

santapaws

10:40 am on Feb 10, 2009 (gmt 0)

10+ Year Member



I wonder if theres a simple way to achieve this without having to use scipts or javascript.
What i am trying to achieve is the url
http://example.com/firstpartofurl.aspx
with the date added to the end with no gaps in the form
http://example.com/firstpartofurl.aspx&date=20090101

the form below will give me the year but i cant work out how to add the day and month without adding unwanted characters or gaps between. If i add field names to each separate section it adds the field names in the form &name= between sections which kills the url. If i dont have field names i cant see how to have three seperate drop down boxes working under one field name.

<form action="http://example.com/firstpartofurl.aspx" method="get">
<select size="1" name="date">
<option value="2009">year</option>

<option value="01">month</option>

<option value="01">day</option>
</select>
<input type="submit" value="submit"
</form>

Cheers! ;)

[edited by: phranque at 12:41 pm (utc) on Feb. 10, 2009]
[edit reason] exemplified urls [/edit]

phranque

12:46 pm on Feb 10, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you would actually need three select elements, but if they have the same name the value passed is an array containing three values.
i'm not sure what that does to the url when you GET a form submit.
why are you using GET instead of POST?