Tip: Passing query string parameters to contact form page
Can I pre-fill in form fields from a URL query string?
Yes, this feature was added in Version 220.127.116.11
What is a Query String? See query string at wikipedia
Here is an example, this is my contact form with a query string to pre-fill the name “My Test Name”:
Query String Rules:
- Begin all queries after the URL with a question mark, do not repeat question marks without URL encoding them.
- The query string is composed of a series of field-value pairs.
- The field-value pairs are each separated by an equals sign.
- The series of pairs is separated by the ampersand character &
- Do not use the ampersand, question mark, or equals character in strings without URL encoding them
- Spaces should be URL encoded as pluses.
- Each field name must begin with the form number (the four standard available forms are numbered 1,2,3,4)
- Field values must be url encoded to avoid problems.
- For security reasons, the Attachment fields and CAPTCHA field cannot be filled in by URL query.
- For security reasons, URL queries can only pre-fill the form, they cannot submit the form. This way security features like the CAPTCHA cannot be bypassed.
- You do not have to fill all the fields with URL queries, you can just fill one or two if you want. The user can fill in the rest.
- If using with extra fields, the extra fields must already be setup on the form edit page. For security reasons, you cannot dynamically add extra fields by query.
What us URL Encoding (percent encoding)? See article at wikipedia
Here is a site with a form to manually encode strings.
URL Encoding inside a PHP script:
<?php $query_string = 'foo=' . urlencode($foo) . '&bar=' . urlencode($bar); echo '<a href="mycgi?' . htmlentities($query_string) . '">click</a>'; ?>
Available form fields to pass a URL query string to?
[form number]name=[string] (Name)
[form number]f_name=[string] (First Name)
[form number]mi_name=[string] (Middle Initial)
[form number]l_name=[string] (Last Name)
[form number]email=[string] (E-Mail Address)
[form number]mailto_id=[number] (use when the Email To: is a drop down list)
[form number]subject=[string] (Subject)
[form number]subject_id=[number] (use when the Subject: is a drop down list)
[form number]message=[string] (Message)
Example: Using a query for the Name field on form number 1:
Example: Using a query for the Name field and Email field on form number 2:
Extra fields with query input:
Types: text, textarea, date, password, hidden
[form number]ex_field[field number]=[string]
Example: form 4 using extra field 2 for text (phone number):
[form number]ex_field[field number]=1 (checked)
Example: form 1 using extra field 4 for checkbox(single)
Types: checkbox(multiple), select-multiple
[form number]ex_field[field number]_[option number]=1 (checked)
Example: form 1 using extra field 5 for checkbox(multiple)
(Pizza Toppings: olives mushrooms cheese ham tomatoes)
(mushrooms option 2, and cheese option 3, selected)
Types: radio, select
[form number]ex_field[field number]=[option number] (checked)
Example: form 3 using extra field 7 for radio (select option 2, no)
(Do you like Onions? yes, no)
?&3ex_field7=2 (no) will be selected
[form number]ex_field[field number]h=[number] (hour 01-12)
[form number]ex_field[field number]m=[number] (minute 00-59)
[form number]ex_field[field number]ap=[string] (AM or PM)
Example: form 1 using extra field 11 for time: 04:30PM
Donations by PayPal:
Donations by cash or check:
PO Box 819
Long Beach WA 98631