Autofilling HTML forms

I have a form created in HTML imploring website visitors to sign up for our newsletter - what I would like to do is email potential signup-ees with the URL of the form, BUT would like the URL to contain “switches” (such as the mailto tag has) so that when the recipient clicks on the hyperlink they arrive at a form with some of their details already filled in…

Is such a thing possible and how would I go about it?

Many thanks
Grim

i’ve only ever accomplished this using javascript or a text pre-processer (ie. php/perl) to generate the form using values passed to the url

http://www.somesite.com/form.html?blah=value&blah2=value2

using javascript you could generate the form using document.write("<input type=‘text’ name=‘blah’ size=‘20’ value=blah>");

in php: echo "<input type=“text” name=“blah” size=“20” value=$blah>
");

etc.

oops. auto-url got me.

form.html?blah=value&blah2=value2 <-- this is where the javascript/php get the values

Yeah, I’d use javascript or a simple ASP script to do something like that… assuming that the webserver the form was on allowed ASP. :slight_smile:

in ASP the code would be something like:


 <input type="text" name="blah" size="20" value="<%= request.querystring("blah") %>">

ie the textfield markup would be almost identical to usual HTML code, except for introducing that <%= %> syntax for the value to be filled in from the link.

Thanks for the comments…

In fact the page in question is in fact an ASP page - we use a content management system where we type in the HTML for the content section of the page, and I forget that it is constructed with ASP…

I’ll give it a try and let you know how it goes!!

Grim