Help with forms.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I was wondering how I could create a form field where the viewer would
be redirected to another webpage depending on the input.

Ex: user types "Jan0106" in the form field

and would get redirected to


Re: Help with forms.

islanderjo wrote:
Quoted text here. Click to load it

You generally shouldn't require the user to enter such bizarre date
formats into a form, you should make it a little more user friendly by
either providing 3 separate fields for day, month and year (as long as
you make it clear which field is which) or using something sensible like
ISO-8601 (e.g. 2006-01-30).

As for redirecting the user, that's a server side issue that can be
easily handled by your form processing script (e.g. PHP, ASP, JSP, Perl,
Python or whatever you like).

for example:

Markup: (minimal example only, some markup omitted for brevity)

<form method="get" action="/article">
<p>Year (4 digits): <input type="text" name="year">
     <select name="month">
<p>Day (1-2 digits): <input type="text" name="day">

When submitted, the server side script will receive values for the year,
month and day, which can then be used to construct the correct file
name, check if one exists for that date and if it does send a 303 See
Other HTTP response with a location header field to redirect the user.

Writing the server side script is off-topic for this newsgroup.

Lachlan Hunt / Rediscover the Web Reclaim your Inbox

Site Timeline