Forum Moderators: open

Message Too Old, No Replies

Passing form values in hyperlink

Using just HTML is there a way to prefill a form with info passed in a link

         

tfanelli

6:26 pm on Aug 2, 2005 (gmt 0)

10+ Year Member



I have seen folks talking about this, but nothing has been exactly what I am looking for. I want to know if there is a way of passing a value to a visible form field though a hyper link. For instance, let say someone was looking at a product on a page, and wanted more info. When the click the link it goes to a request info form, and the product name and color is prefilled based on the link from the product. This would mean they would not have to choose the product from a list.

Thanks

garann

7:01 pm on Aug 2, 2005 (gmt 0)

10+ Year Member



An easy way of doing this without server side scripting would be to pass the name and color in the querystring. So you link would be something like

<a href="nextpage.html?name=Widget&color=blue">Order a widget</a>

Then you'd have code to parse the querystring on nextpage.html. This article [eggheadcafe.com] seems to give a good example of the code you'd need.