AWEBER javascript integration - javascript

i have 2 raw aweber html code, they are in separate accounts. now i want to have 1 sign up form for this two raw codes. Means when someone sign up on my form, the email should the be saved on my two list. but i got problem on how to integrate this two codes. When i remove 1 form it work for only 1 list but when i integrate the two it doesn't save any email on the two list.
heres my code ,sorry for my poor coding im new to javascript im trying hard to solved this problem hope someone can help me.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<!--1st-->
<script language="javascript">
function copy_fields(){
<!--document.getElementById('name1').value = document.getElementById('name').value;
document.getElementById('from1').value = document.getElementById('email').value;
}
function validate(){
var filter = /^([a-zA-Z0-9_\.\-])+\#(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if((document.submail.email.value=='')||(document.submail.email.value=='Email Address'))
{alert('Please Enter Email Address'); return false;}
if (!filter.test(document.submail.email.value))
{alert('Please Enter A Valid Email'); return false;}
document.getElementById('sub9').className='gray_out';
document.getElementById('sub9').disabled='true';
copy_fields();
document.form2.submit();
setTimeout('document.submail.submit()',3000);
}
</script>
<style type="text/css">
.gray_out {
filter:alpha(opacity=40);
-moz-opacity:.40;
opacity:.40;
}
</style>
<!--END 1st-->
<!--2nd-->
<script language="javascript">
function copy_fields1(){
<!--document.getElementById('name1').value = document.getElementById('name').value;
document.getElementById('from1').value = document.getElementById('email').value;
}
function validate1(){
var filter = /^([a-zA-Z0-9_\.\-])+\#(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if((document.submail.email.value=='')||(document.submail.email.value=='Email Address'))
{alert('Please Enter Email Address'); return false;}
if (!filter.test(document.submail.email.value))
{alert('Please Enter A Valid Email'); return false;}
document.getElementById('sub9').className='gray_out';
document.getElementById('sub9').disabled='true';
copy_fields1();
document.form1.submit();
setTimeout('document.submail.submit()',3000);
}
</script>
<style type="text/css">
.gray_out {
filter:alpha(opacity=40);
-moz-opacity:.40;
opacity:.40;
}
</style>
<!--END 2nd-->
</head>
<body>
<form name="submail" method="post" action="http://empowerauthoritypro.com/commission-loophole-ninja" >
<input type="hidden" name="go" value="now" />
<!-- First Name:<br />
<input id="name" type="text" name="name" value="First Name" onclick="if(this.value=='First Name') this.value=''" class="text-field" /><br />-->
Email:<br />
<input id="email" type="text" name="email" value="Email Address" onclick="if(this.value=='Email Address') this.value=''" class="text-field" />
<!--Optin Now-->
<input type="button" id="sub9" value="Submit" onClick='window.open(validate1())' />
</form>
<!--1st has email requirement only-->
<form name="form2" method="post" action="http://www.aweber.com/scripts/addlead.pl" target="iframe" style="display:none">
<input type="hidden" name="meta_web_form_id" value="1817364894" />
<input type="hidden" name="meta_split_id" value="" />
<input type="hidden" name="listname" value="dummylistshaq" />
<input type="hidden" name="redirect" value="http://www.aweber.com/thankyou.htm?m=default" /><input type="hidden" name="meta_adtracking" value="ninjatest" />
<input type="hidden" name="meta_message" value="1" />
<input type="hidden" name="meta_required" value="email" />
<input type="hidden" name="meta_tooltip" value="" />
<div style="display:none">
<img src="http://forms.aweber.com/form/displays.htm?id=jByM7MxsLBycLA==" alt="" width="1" height="1" />
</div>
<input type="text" name="email" id="from1" value="" size="20">
</form>
<iframe name="iframe" style="display:none"></iframe>
<!--END 1st-->
<!--2nd has name and email requirement but i have compromise the name to be hide-->
<form name="form1" method="post" action="http://www.aweber.com/scripts/addlead.pl" target="iframe" style="display:none">
<input type="hidden" name="meta_web_form_id" value="1376972149" />
<input type="hidden" name="meta_split_id" value="" />
<input type="hidden" name="listname" value="optinninja1" />
<input type="hidden" name="redirect" value="http://www.aweber.com/thankyou.htm?m=default" /><input type="hidden" name="meta_adtracking" value="ninjaoptin" /><input type="hidden" name="meta_message" value="1" />
<input type="hidden" name="meta_required" value="name,email" />
<input type="hidden" name="meta_tooltip" value="" />
<div style="display:none">
<img src="http://forms.aweber.com/form/displays.htm?id=jMzsbJzsTIwsnA==" alt="" width="1" height="1" />
</div>
<input type="hidden" name="name" id="name1" value="" size="20">
<input type="text" name="email" id="from1" value="" size="20">
</form>
<iframe name="iframe" style="display:none"></iframe>
<!--END 2nd-->
</body>
</html>

A better (and AWeber-supported) way to integrate multiple services with your AWeber list is to use the AWeber API.
Another possibility might be to set up a PHP page on your own site, set it as your AWeber Form's "Thank You Page", and code your PHP to take advantage of the Pass Subscriber Data feature:
https://help.aweber.com/entries/21775518-how-do-i-pass-form-data-to-my-thank-you-pages
I'm a bit confused regarding your desired workflow. You mention submitting to two AWeber lists, yet there is a third form in your code as well that posts to a third party.
I highly recommend getting in touch with AWeber Customer Solutions who will be able to address your needs more comprehensively. Just email help#aweber.com or visit https://www.aweber.com/contact-us.htm and a team member will take an in-depth look.

Related

Submitting Form in a popup window

I know that this might seem like a duplicate, but i can't seem to figure this out. I am wanting to submit a form in HTML to a Popup window. when i hit the submit button, it returns a blank page. I want the pop up to display all of the input that one filled out one the form. I want to do it in JavaScript. This is my code here. I want it to output all of the information entered in the form, from the Personal Information fieldset and the personal choices fieldset. I want it to display as an unordered list.
Heres the Javascript that i have so far:
<head>
<title>My Form</title>
<script type="text/javascript">
function display() {
dispWin = window.open('','NewWin',
'toolbar=no,status=no,width=300,height=200')
message = "<ul><li>First Name:" +
document.mdForm.first_name.value;
message += "<li>Last Name:" +
document.mdForm.the_lastname.value;
message += "<li>Address:" +
document.mdForm.the_address.value;
message += "</ul>";
dispWin.document.write(message);
}
</script>
Heres the HTML:
<body>
<h1>My Form</h1>
<form name="mdForm" method="post" action="">
<fieldset>
<legend>Personal Information</legend>
<p><label class="question" for="first_name">What is your First name?
</label>
<input type="text" id="first_name" name="first_name"
placeholder="Enter your First name."
size="50" required autofocus /></p>
<p><label class="question" for="the_lastname">What is your Last name?
</label>
<input type="text" id="the_lastname" name="the_lastname"
placeholder="Enter your Last name."
size="50" required /></p>
<p><label class="question" for="the_address">What is you address?
</label>
<input type="text" id="the_address" name="the_address"
placeholder="Enter your address."
size="50" required /></p>
<p><label class="question" for="the_email">What is your e-mail address?
</label>
<input type="email" id="the_email" name="the_email"
placeholder="Please use a real one!"
size="50" required /></p>
</fieldset>
<fieldset>
<legend>Personal Choices</legend>
<p><span class="question">Please check all your favorite foods:</span>
</br>
<input type="checkbox" id="food_one" name="some_statements[]"
value="Buffalo Wings" />
<label for="food_one">Buffalo Wings</label><br/>
<input type="checkbox" id="food_two" name="some_statements[]"
value="Enchiladas" />
<label for="food_two">Enchiladas</label><br/>
<input type="checkbox" id="food_three" name="some_statements[]"
value="Hamburgers" />
<label for="food_three">Hamburgers</label><br/>
<input type="checkbox" id="food_four" name="some_statements[]"
value="Spaghetti" />
<label for="food_four">Spaghetti</label></p>
<p><span class="question">Select your favorite online store:</span><br/>
<input type="radio" id="the_amazon" name="online_store"
value="amazon" />
<label for="the_amazon">Amazon</label><br/>
<input type="radio" id="bestbuy_electronics" name="online_store"
value="bestbuy" />
<label for="bestbuy_electronics">BestBuy</label><br/>
<input type="radio" id="frys_electronics" name="online_store"
value="frys" />
<label for="frys_electronics">Frys Electronics</label><br/>
</p>
<p><label for="my_band"><span class="question">Who's your favorite band/ artist?</span></label><br/>
<select id="my_band" name="my_band" size="4" multiple>
<option value="The Chi-Lites">The Chi-Lites</option>
<option value="Michael Buble">Michael Buble</option>
<option value="Frank Ocean">Frank Ocean</option>
<option value="Labrinth">Labrinth</option>
</select>
</p>
</fieldset>
<div id="buttons">
<input type="submit" value="Click Here to Submit" onclick="display();" />
or
<input type="reset" value="Erase and Start Over" />
</div>
</form>
</body>
Have you prevented the default submit functionality?
Try:
function display(e) {
//To stop the submit
e.preventDefault();
...
Do your Stuff
...
//Continue the submit
FORM.submit();
}

insertion is not happening in php and mysql form

My database fields are: id,name,email_id,address,phone_no,username,password,category,date
<?php
include_once('connect_to_mysql.php');
if(isset($_POST["submit"])){
$a=mysql_real_escape_string($_POST["name"]);
$b=mysql_real_escape_string($_POST["email"]);
$c=mysql_real_escape_string($_POST["address"]);
$d=mysql_real_escape_string($_POST["phoneno"]);
$e=mysql_real_escape_string($_POST["user"]);
$f=mysql_real_escape_string($_POST["pass"]);
$g=mysql_real_escape_string($_POST["category"]);
$res=mysql_query("insert into reg(name, email_id, address, phone_no, username, password, category, date ) values ( '$a', '$b', '$c', '$d', '$e', 'md5[$f]', '$g', now() )") or die (mysql_error() );
$id = mysql_insert_id();
}
?>
There's no error reported when using the submit button, but found data is not inserted into database. I don't know what causes this.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Register </title>
</head>
<body>
<div id="heading12"><?php //include_once("header.html") ?></div>
<br /><br /><br /><br /><br /><br /><br />
<div id="mainWrapper" style="background-color:#ECEEFB">
<div align="center" id="pageContent" style="background-image:url(back3.png); width:1000px;"><br /><br /><br />
<div align="center" style="color:#000000;">
<h2 style="font-size:36px">Please Fill Your all Details to Register</h2>
<br /><br />
<form id="form" name="form" method="post" action="register.php">
<h2 style="padding-right:200px;"> Name:</h2>
<input name="name" type="text" id="name" size="40" style="height:30px; font-size:20px " required placeholder="Enter NAME"/>
<br /><br />
<h2 style="padding-right:200px;">Email Address:</h2>
<input name="email" type="text" id="email" size="40" style="height:30px; font-size:20px " required placeholder="Enter Email Address"/>
<br /><br />
<h2 style="padding-right:200px;">Address</h2>
<textarea name="address" id="address" cols="44" rows="6" style="font-size:19px " required placeholder="Enter Address"></textarea>
<br /><br />
<h2 style="padding-right:200px;">Phone No.</h2>
<input name="phoneno" type="text" id="phoneno" size="40" style="height:30px; font-size:20px" required placeholder="Enter Phone No."/>
<br /><br />
<h2 style="padding-right:200px;">User Name:</h2>
<input name="user" type="text" id="user" size="40" style="height:30px; font-size:20px" required placeholder="Enter UserName"/>
<br /><br />
<h2 style="padding-right:210px;">Password:</h2>
<input name="pass" type="password" id="pass" size="40" style="height:30px; font-size:20px" required placeholder="Enter Password"/>
<br /> <br />
<h2 style="padding-right:250px;">Category:</h2>
<select name="category" id="category" style="height:30px; font-size:20px; padding-right:290px;" required placeholder="Enter The Value" >
<option value="none">Choose Any</option>
<option value="product buyer">Product Buyer</option>
<option value="product seller">Product Seller</option>
</select>
<br /> <br />
<img style="padding-right:280px;" src="generate.php"><br /><br />
<input type="text" name="secure" size="10" required placeholder="Enter The Value" style="padding-right:290px; height:30px; font-size:20px">
<br /> <br /> <br />
<input type="submit" name="log" id="log" value="Register" style="padding-right:40px; font-size:20px" />
</form>
<p> </p>
</div>
<br />
<br />
<br />
</div>
</div>
</body>
</html>
you have nothing with a name of "submit". $_POST['submit'] is never set, and your if function never runs.
your condition is looking for $_POST['submit']
$_POST['submit'] is not present
replace $_POST['submit'] by $_POST and it gets your all data
one more thing Php eliminate mysql for some reason, use mysqli for database connections and query's
Please look at the HTML for the submit button ->
input type="submit"
In your php code, you're checking if a submit button with a name "submit" exists, but actually, the name of the submit button is "log"
if(isset($_POST["submit"])) needs to be changed to if(isset($_POST["log"]))
That's all! :)

reCaptcha first timer issues

I am trying to use reCaptcha for the first time and this is the code I wrote so far but it doesn't seem to work.
This is my html form:
<form method="post" action=''>
<cfoutput>
<input type="hidden" name="isPost" value="1" />
First Name: <input type="text" name="firstname" placeholder="First name" required><br />
Last Name: <input type="text" name="lastname" placeholder="Last name" required><br />
Email: <input type="email" name="email" placeholder="example#email.com" required><br />
Zip Code: <input id="zip" type="text" pattern="[0-9]{5}" name="zipcodex" placeholder="ex. 01234" required /><br />
Home Phone: <input type="tel" pattern='[0-9]{10}' name="homephone" placeholder="ex. 3335551234" required><br />
Cell Phone: <input type="tel" pattern='[0-9]{10}' name="cellphone" value="#cellphone#" placeholder="ex. 9990001234"><br />
My Interest
<select class="interestOption" name="Formprocedure" id="procedure" required >
<option selected="selected" disabled="disabled" value="">My Interest</option>
<cfloop query="procedurefinder"><option <cfif procedureid eq Formprocedure>selected="selected" </cfif>title="#procedurename#" value="#procedureid#">#left(procedurename,20)#</option>
</cfloop>
</select><br />
<textarea name="comments" cols="50" rows="5" placeholder="Please enter any additional comments"></textarea><br />
<script type="text/javascript"
src="http://www.google.com/recaptcha/api/challenge?k=6LdUMuISAAAAA********mMK5cbR1pm1AG4WV">
</script>
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=6LdUMuISAAAAAMi**************mMK5cbR1pm1AG4WV"
height="50" width="400" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="0">
</textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge">
</noscript>
<br />
<button id="submit" onclick="SubmitForm();">Submit</button>
</cfoutput>
</form>
This is my JS code:
<script type="text/javascript">
function SubmitForm(){
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST",'http://www.google.com/recaptcha/api/verify',true);
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
params ="'6LdUMuISAAAAAMi4iDZ1sIuEmMK5cbR1pm1AG4WV','www.newimagespecialists.com','"+Recaptcha.get_response()+"','"+Recaptcha.get_challenge+"'";
xmlHttp.send(params);
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
if(xmlHttp.status == 200){
form.submit();
}else{
return false;
}
}
}
}
</script>
This is the response I am getting from firebug:
Parameters application/x-www-form-urlencoded
'6LdUMuISAA1sIuE... =typeof RecaptchaState?null:RecaptchaState.challenge}'
Source
'6LdUMAA*******IuEmMAG4WV','www.example.com','fitsesq Accord','function (){return"undefined"==typeof RecaptchaState?null:RecaptchaState.challenge}'
My issue is that I don't really understand where I have a mistake in the code and also why my form continues to submit? Any one can give any pointer as to where I am making a mistake?
To prevent your form from submitting, you have to do this:
<form method="post" action='' onsubmit="return false">
In your code, you write something like:
Recaptcha.get_response()+"','"+Recaptcha.get_challenge
check that Recaptcha.get_challenge should be replaced with Recaptcha.get_challenge() and the ajax api is loaded.
<script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
And check that you create the recaptcha properly using Recaptcha.create

Simple javascript form validation not working in Django?

I have a simple form to take user input. User must fill very fields in that form. If they don't, javascript gives the alert message but it's not working. I am not getting alert message if I submit the form empty. Here's my form.html:
</style>
<script type="text/javascript">
function Validate(){
if(document.simple_form.session.value == "" ||
document.simple_form.hostname.value == "" ||
document.simple_form.username.value == ""
document.simple_form.password.value == "")
{
alert("Please fill out all fields before clicking Load!");
return false;
}
}
</script>
</head>
<body>
<form action="." method="post" onsubmit="return Validate();" name="simple_form">
{% csrf_token %}
<fieldset>
<legend>Session</legend>
<label for="input-one" class="float"><strong>Session Name:</strong></label><br />
<input class="inp-text" name="session" id="sess" type="text" size="30" /><br />
<label for="input-two" class="float"><strong>RemoteHost:</strong></label><br />
<input class="inp-text" name="hostname" id="host" type="text" size="30" onblur="if(this.value=='') { this.value='ngs.pradhi.com:/upload' }" onfocus="if(this.value=='ngs.pradhi.com:/upload') { this.value='' }" value="ngs.pradhi.com:/upload" />
<label for="input-three" class="float"><strong>Username:</strong></label><br />
<input class="inp-text" name="username" id="user" type="text" size="30" />
<label for="input-four" class="float"><strong>Password:</strong></label><br />
<input class="inp-text" name="password" id="pass" type="password" size="30" />
</fieldset>
<p><input class="submit-button" type="submit" value="Load" /></p>
<p><input class="save-button" type="reset" name="cancel" value="Cancel" /></p>
</form>
Is there something I am missing?
You're missing a final || in your Validate() function.
I've got a working jsfiddle here (I added a couple of </br>'s too).

jQuery form Validation not working?

this is my code for the "contact us" web page. How come it doesn't work with the jquery validator plugin? Did i do something wrong? Please help. Thanks!
The validator simply doesn't work. It allows submitting the form even I didn't fill out anything.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>
<script>
$(document).ready(function(){
$("#myform").validate();
});
</script>
</head>
<body bgcolor="#ffffff">
<div id="contactuscontent">
<form class="cmxform" id="myform" method="post" action="sendmail.php">
Your Name: <br />
<input type="text" name="visitor" size="35" />
<br />
Your Email:<br />
<input type="email" name="visitormail" size="35" />
<br /> <br />
Subject:<br />
<input type="text" name="subject" size="35" />
<br /><br />
Mail Message:
<br />
<textarea name="notes" rows="4" cols="40" ></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
</form>
</div>
</body>
</html>
Your code works fine, but you didn't put any validation rule, that's why it does nothing.
EDIT: At least, add a class="required" to your mandatory inputs.
Best Regards.
<script>
$(document).ready(function(){
$("#myform").validate();
});
</script>
</head>
<body bgcolor="#ffffff">
<div id="contactuscontent">
<form class="cmxform" id="myform" method="post" action="sendmail.php">
Your Name: <br />
<input type="text" name="visitor" class="required" size="35" />
<br />
Your Email:<br />
<input type="email" name="visitormail" class="email required" size="35" />
<br /> <br />
Subject:<br />
<input type="text" name="subject" class="required" size="35" />
<br /><br />
Mail Message:
<br />
<textarea name="notes" rows="4" cols="40" class="required" ></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
</form>
</div>
</body>
</html>
you just need to add classes that you want on each imput not gonna go into detail but you need to look at web standards for html forms and input as well as good formatting practices
Well, jQuery is awesome. But you can do a JavaScript Form Validation without jQuery also. May refer to this JavaScript Form Validation Tutorial.

Categories

Resources