/    Sign up×
Community /Pin to ProfileBookmark

submit button – close window and no redirect?

Hi

This is the code I have to make my subscribe pop-up close without going to a thankyou page. It doesn’t work, but I feel like it should. Do you know why it doesn’t work and if so can you let me know, please?

URL is [url]www.chaserbrand.com[/url]

Thanks!
phil

<div id=”js-pop”>
<div class=”newsletter-form”>
<form id=”js-form” form name=”catwebformform12809″ method=”post” onsubmit=”return checkWholeForm12809(this)” enctype=”multipart/form-data” action=”/FormProcessv2.aspx?WebFormID=63459&amp;OID={module_oid}&amp;OTYPE={module_otype}&amp;EID={module_eid}&amp;CID={module_cid}”>

</p>
<table class=”webform” cellspacing=”0″ cellpadding=”2″ border=”0″>
<tbody>
<tr>
<td><label for=”FirstName”> <span class=”req”></span></label><br />
<input type=”text” name=”FirstName” id=”FirstName” value=”no” style=”display:none” class=”cat_textbox” maxlength=”50″ /> </td>
</tr>
<tr>
<td><label for=”LastName”> <span class=”req”></span></label><br />
<input type=”text” name=”LastName” id=”LastName”value=”no” style=”display:none” class=”cat_textbox” maxlength=”50″ /> </td>
</tr>
<tr>
<td><label for=”EmailAddress”>Email Address <span class=”req”></span></label><br />
<input type=”text” name=”EmailAddress” id=”EmailAddress” class=”cat_textbox” maxlength=”50″ /> </td>
</tr>
<tr>
<td><input class=”cat_button” type=”submit” value=”Submit” onclick=”self.close()” id=”catwebformbutton” /></td>
</tr>
<tr>
<td><input name=”CampaignList_55238″ type=”checkbox” style=”display:none” value=”default” checked=”checked” /></td>
</tr>
</tbody>
</table>
<script type=”text/javascript” src=”/CatalystScripts/ValidationFunctions.js”></script>

<script type=”text/javascript”>
//<![CDATA[
var submitcount12809 = 0;

function checkWholeForm12809(theForm) {
var why = “”;
if (theForm.FirstName) why += isEmpty(theForm.FirstName.value, “First Name”);
if (theForm.LastName) why += isEmpty(theForm.LastName.value, “Last Name”);
if (theForm.EmailAddress) why += checkEmail(theForm.EmailAddress.value);
if (why != “”) {
alert(why);
return false;
}
if (submitcount12809 == 0) {
submitcount12809++;
finishCTA(“chaser-popPerm”);

var cForm = $(“#js-form”);
var data = cForm.serialize();
$(“#js-pop”).dialog(“close”);
$.post(cForm.attr(“action”), data, function (data, t, jqxhr) {

});
$(“#js-pop”).dialog(“close”);

//theForm.submit();
return false;
} else {
alert(“Form submission is in progress.”);
return false;
}
}
//]]>
</script>

</form>

//theForm.submit();
return false;
} else {
alert(“Form submission is in progress.”);
return false;
}
}
//]]>
</script>

</div>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @mcliam spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...