Can't get form to submit email address correctly

mpbiz

New member
Apr 29, 2010
2,825
57
0
So I have this new lead capture page I setup today and I'm trying to get it to work with getresponse. After messing around with the code this is what I have so far:

<div id="form">
<form action="https://app.getresponse.com/add_contact_webform.html" method="post">

<input type="text" id="email" value="Enter a Valid Email Here" onfocus="if(this.value=='Enter a Valid Email Here') this.value='';" onblur="if(this.value=='') this.value='Enter a Valid Email Here';">

<input type="image" id="submit" value="296610" src="http://www.mywebsite.com/submitbuttonimage.jpg"/>

<input type="hidden" name="webform_id" value="296610" />
<div class="clear"></form>
For some reason though whenever I test this I get an error from getresponse telling me that I entered an invalid email address so clearly my above code isn't submitting what I'm typing in the field.

As always thanks for the help.
 


this

<input type="text" id="email" value="Enter a Valid Email Here" onfocus="if(this.value=='Enter a Valid Email Here') this.value='';" onblur="if(this.value=='') this.value='Enter a Valid Email Here';">

is some mindfucking code. I would try and simplify this before continuing.
 
That code isn't so much mindfucking as it is just plain terrible. Scotch and I have been hanging out tonight so I can't directly help you but I can guarantee that code isn't doing you any favors
 
You don't have a "name='email'" in that HTML tag. You have an "id" attribute, but need a "name" attribute. Change to:

<input type="text" id="email" name="email" value="Enter a Valid Email Here" onfocus="if(this.value=='Enter a Valid Email Here') this.value='';" onblur="if(this.value=='') this.value='Enter a Valid Email Here';">
 
  • Like
Reactions: mpbiz
That code isn't so much mindfucking as it is just plain terrible. Scotch and I have been hanging out tonight so I can't directly help you but I can guarantee that code isn't doing you any favors

Setting something to ; conditionally onfocus is quite bizarre. Thankfully Matt doesn't seem to be drinking on a Monday like ol' dchuk here and we got that sorted out though
 
It's setting the value to blank.

He probably doesn't have an "E-Mail:" label in the form, and uses the textbox instead. When someone first focuses on the textbox, it empties the value of "Enter a Valid Email Here" and shows a blank textbox instead.