View previous topic :: View next topic |
Author |
Message |
jdub1273
Joined: 28 Feb 2009 Posts: 4
|
Posted: Mon Mar 02, 2009 10:48 am Post subject: Need help adding a field in the HTML. |
|
|
If anyone knows how to help me I would appreciate it! I need to add a field in the HTML that will come back to me when the form is submitted but will be hidden on the form page. I need to add the field "leadsource" from which I will give each form a leadsource name. I need this so the form will populate correctly into mt data management software.
Thanks!
Jason |
|
Back to top |
|
 |
mycontac Site Admin
Joined: 31 Dec 2003 Posts: 2860
|
Posted: Tue Mar 03, 2009 1:43 pm Post subject: Reply |
|
|
This is certainly a bit of a 'hack' as there is no way to do this in the administration panel. Here is how it can be done:
1. Add a new question to your form. A simple text box with a question name called 'leadsource' works.
2. Regenerate the HTML and copy it to your local HTML file where it will live.
3. Look at the HTML and find the HTML code for the text box that your created for the leadsource question. It should look sort of like this (but it will be a bit different):
Code: |
<input name="q[some#]" type="text" id="q[some#]" value="" size="some #" maxlength="some #"> |
Alter this form element so:
Becomes:
Then, change the portion that says:
To:
Code: |
value="whatever leadsource name you want" |
Now, delete the following bits which aren't needed:
Code: |
size="some #" maxlength="some #" |
4. Once you have altered the code you should have something that looks like this:
Code: |
<input name="q[some#]" type="hidden" id="q[some#]" value="whatever leadsource name you want"> |
Take this bit of code and cut it out of you form. Now pasted it directly after the opening form tag. The beginning of your form code should look something like this:
Code: |
<!-- Begin myContactForm.com Form HTML -->
<form name="contactForm" method="post" action="http://www.mycontactform.com/sendform/sendform.php">
<input name="q[some#]" type="hidden" id="q[some#]" value="whatever leadsource name you want">
|
5. Now you can manually delete the leftovers from the form question you added (basically an extra table row and some text 'leadsource' that you no longer need because that field is now hidden).
This should do the trick.
Nick Ladd
myContactForm.com |
|
Back to top |
|
 |
|