Back to myContactForm.com - Easy email form creation and processing for your web site
myContactForm.com - Help Forum Forum Index myContactForm.com - Help Forum
Have a question that you need answered about myContactForm.com? Post it on this message board but first search this forum and read out FAQ to ensure it has not already been answered. This is not a board to post links to your site! SPAM will be deleted!
 
   Search MessagesSearch Messages
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help adding a field in the HTML.

 
Post new topic   Reply to topic    myContactForm.com - Help Forum Forum Index -> Form Management
View previous topic :: View next topic  
Author Message
jdub1273



Joined: 28 Feb 2009
Posts: 4

PostPosted: Mon Mar 02, 2009 10:48 am    Post subject: Need help adding a field in the HTML. Reply with quote

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
View user's profile
mycontac
Site Admin


Joined: 31 Dec 2003
Posts: 2860

PostPosted: Tue Mar 03, 2009 1:43 pm    Post subject: Reply Reply with quote

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:

Code:
type="text"


Becomes:

Code:
type="hidden"


Then, change the portion that says:

Code:
value=""


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
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    myContactForm.com - Help Forum Forum Index -> Form Management All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.11 © 2001, 2002 phpBB Group