Click here to Skip to main content
15,671,597 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello. I'm using Salesforce marketing cloud web collect form.

I would like a thank you message to be displayed instead of a redirect. I an't figure out how.

Please help.

What I have tried:

<?php
    $msg = $_GET['msg'];
        if ($msg == "err")
            { ?> 

<div>

<form action=" http://cl.exct.net/subscribe.aspx" method="post" name="subscribeForm" onSubmit="return formCheck(this);">
		<input type=hidden name="MID" value="uniqueID">

<input type=hidden name="lid" value="uniqueID">
  
<input name="thx" type="hidden" value="#" />

<input name="err" type="hidden" value="#" /> 

    <input type="text" name="Email Address" placeholder="Business Email Address"
style="padding:10px; min-width:250;">
    <br 

/><p></p>
    
<input type="hidden" name="subAction" value="sub_add_update" />

<input type="submit" value="SUBMIT" style="height:36px; width:100px; background:#286a92;font-
weight: 600; color:#ffffff; text-

transform: capitalize; border: 1px solid; text-transform:
capitalize;">

<script type="text/javascript"> 
<!--
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();
curr_month++;
var curr_year = d.getFullYear();
document.getElementsByName('SubscriberDate')[0].value = ("0" + curr_month).slice(-2) + "/" + ("0" + curr_date).slice(-2) + "/" + 

curr_year;
 
 function formCheck(formobj){
		
		 
	// Enter name of mandatory fields
	var fieldRequired = Array("Email Address");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Email Address");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}
 
	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}
// -->
</script></form>
</div>
<?php 
}
?>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900