Forum Moderators: phranque
If a viewer browsers onto my "red widget" page and then decides to make an enquiry, how do I get the first field of the form to automatically read "red widget", without having to make 6 different forms? I am not really programmer status and I use DW MX to make sites. Effectively removing the need to select “red widget” from a drop down is what I am trying to achieve.
Any suggestions?
Thanks.
<a href="myform.asp?val=redwidget">
I would have to write code something like the following to extract the value and create my form.
<%
dim val
val = Request.QueryString("val") ' Contains "redwidget"
%>
<form name="form1" action="myhandler.asp">
<input type="text" value="<%=val%>" name="text1">
<input type="submit">
</form>
But, I've never used DW so I don't know what the equivalent would be. Also, it could be created to be much more functional. For example, in my case I pass a querystring value that I use to extract values from a database to initialize the form.
Sorry I was so unclear before.
So, if I use a small piece of ASP to process the form, which I do, then it is in there that I need to add the bit above that you just posted.?
So, if I use a small piece of ASP to process the form, which I do, then it is in there that I need to add the bit above that you just posted.?
Cool. So you either code against IIS or Macromedia has some integrated support built into their server which allows ASP to run. So this proves my DW ignorance :)
Sounds like you should be able to mod the code snippet to meet your requirements.
I use a little javascript function for this which is very easy:
function setPart() {
for ( i=0; i<document.stuForm.vpart.options.length; i++) {
//alert( document.stuForm.vpart.options[i].value );if (document.stuForm.vpart.options[i].value == document.stuForm.part.value) {
//alert("Match!");[\1]
document.stuForm.vpart.selectedIndex = i;[\1]
}
}
}
There are hidden input fields which contain the page information.
At the bottom of the page I call the function.
I was looking at using one form and just having the name of the "widget" already displayed at the top of the form depending on what particular "widget" page they were referred from!
Widget Type : Red Widget
Date of Delivery : TEXT FIELD
Email Address : TEXT FIELD
....etc