Passing form values in URL

I am trying to use a link to pass a value to a form and for the life of me I’m not getting it to work.

The url to the form:

http://myproof.thebigerns.com/inmark-contact-form/index.html

Here is how I’m formatting it:

http://myproof.thebigerns.com/inmark-contact-form/index.html?itemref=3688

This is targeting the field’s name attribute. When that didn’t work, I tried targeting the field’s id attribute:

http://myproof.thebigerns.com/inmark-contact-form/index.html?Item-Ref=3688

I can’t remember now how I’ve done this before, nor can I find anything online that is clear about the method. Can anyone spot what I’m obviously not getting about this?


offtopic mailing list
email@hidden
Update your subscriptions at:

The querystring or GET attributes are not like anchors, if that’s what you are trying to do. Use an octothorpe and the ID, if you want the link to directly access the sub-page element.

Now if you are sending these name/value pairs to a form handler application, then you will want to format it as you have, and then if you point that link to Reflector, you will see that the data is being sent. Your form handler should be ready to receive it, though – most form handlers use a “whitelist” of acceptable inputs, so they can ignore any malicious attempts to fuzz the handler with bad data.

Walter

On Nov 9, 2015, at 11:59 PM, The Big Erns email@hidden wrote:

I am trying to use a link to pass a value to a form and for the life of me I’m not getting it to work.

The url to the form:

http://myproof.thebigerns.com/inmark-contact-form/index.html

Here is how I’m formatting it:

Thebigerns.com

This is targeting the field’s name attribute. When that didn’t work, I tried targeting the field’s id attribute:

http://myproof.thebigerns.com/inmark-contact-form/index.html?Item-Ref=3688

I can’t remember now how I’ve done this before, nor can I find anything online that is clear about the method. Can anyone spot what I’m obviously not getting about this?


offtopic mailing list
email@hidden
Update your subscriptions at:
Information for existing FreewayTalk / Groups.io users - Site Feedback - Softpress Talk


offtopic mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

The querystring or GET attributes are not like anchors, if that’s what you are trying to do. Use an octothorpe and the ID, if you want the link to directly access the sub-page element.

Now if you are sending these name/value pairs to a form handler application, then you will want to format it as you have, and then if you point that link to Reflector, you will see that the data is being sent. Your form handler should be ready to receive it, though – most form handlers use a “whitelist” of acceptable inputs, so they can ignore any malicious attempts to fuzz the handler with bad data.

For clarity, what I am trying to do is pre-fill a couple of the form fields using the url link the user clicked to reach the form page. The user can then fill out the rest of the form and submit it to the form handler script.

So if the user is looking at the page for Item Reference #3388 and wishes to inquire about it, the link to the contact form page would pre-fill the itemref form field with 3388. The user would fill the other fields and then submit the form contents to the form handler script.


offtopic mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Okay, I figured it out.

What I needed was something to handle the url query-- the browser alone won’t do it. Mailto links can repopulate a new email, so I probably just assumed it all worked that way. So, javascript to the rescue.

I started patching together a script which examines the url for a query string, finds the expected form and fields, translates the query string and inserts the data into the appropriate form fields.

So my link from the product page to the contact page:

http://myproof.thebigerns.com/inmark-contact-form/index.html?itemref=3688&itemname=Sullair%20375HH-200psi

automatically pre-fills part of the form as I needed. The script is linked to in the document head and then triggered by an onload command on the body element.


offtopic mailing list
email@hidden
Update your subscriptions at:

Took the words right out of my mouth!

Walter

On Nov 10, 2015, at 11:20 AM, The Big Erns email@hidden wrote:

Okay, I figured it out.

What I needed was something to handle the url query-- the browser alone won’t do it. Mailto links can repopulate a new email, so I probably just assumed it all worked that way. So, javascript to the rescue.

I started patching together a script which examines the url for a query string, finds the expected form and fields, translates the query string and inserts the data into the appropriate form fields.

So my link from the product page to the contact page:

thebigerns.com

automatically pre-fills part of the form as I needed. The script is linked to in the document head and then triggered by an onload command on the body element.


offtopic mailing list
email@hidden
Update your subscriptions at:
Information for existing FreewayTalk / Groups.io users - Site Feedback - Softpress Talk


offtopic mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options