FAQ > All Post Contact Form ( WordPress Plugin )

How to check the users' data ( how to use allpost-contactform.js )

How to check the users' data ( how to use allpost-contactform.js )

Yes.

(1) Create a list of elements that you'd like to check out like this:


E-mail
postalcode
address
message



(2) Give serial numbers at the line-tops of the list of (1) like this:


1 E-mail
2 postalcode
3 address
4 message



(3) Add


var x"

at the left of the serial numbers of (2) like this:


var x1 E-mail
var x2 postalcode
var x3 address
var x4 message



(4) Add


= document.forms["rl_apcf"]["

between the serial numbers of (3) and elements that you'd like to check out like this:


var x1 = document.forms["rl_apcf"]["E-mail
var x2 = document.forms["rl_apcf"]["postalcode
var x3 = document.forms["rl_apcf"]["address
var x4 = document.forms["rl_apcf"]["message



(5) Add

"].value;

at the right of the elements that you'd like to check out like this:


var x1 = document.forms["rl_apcf"]["E-mail"].value;
var x2 = document.forms["rl_apcf"]["postalcode"].value;
var x3 = document.forms["rl_apcf"]["address"].value;
var x4 = document.forms["rl_apcf"]["message"].value;



(6) Copy (5) and paste it to allpost-contactform.js, under the part of this:


function checkForm() {

//va*r x1 = document.forms["rl_apcf"]["E-mail"].value;

//va*r x2 = document.forms["rl_apcf"]["postalcode"].value;

//va*r x3 = document.forms["rl_apcf"]["address"].value;



If you've done above, your allpost-contactform.js looks like below:


function checkForm() {

//va*r x1 = document.forms["rl_apcf"]["E-mail"].value;

//va*r x2 = document.forms["rl_apcf"]["postalcode"].value;

//va*r x3 = document.forms["rl_apcf"]["address"].value;
var x1 = document.forms["rl_apcf"]["E-mail"].value;
var x2 = document.forms["rl_apcf"]["postalcode"].value;
var x3 = document.forms["rl_apcf"]["address"].value;
var x4 = document.forms["rl_apcf"]["message"].value;



(7) Add a process of "pop-up to urge users to input" to elements that you'd like to check out like this:


if (x1 == "") {
alert("Would you input your E-mail address?");
return false;
}

if (x2 == "") {
alert("Would you input your Postal Code?");
return false;
}

if (x3 == "") {
alert("Would you input your Address?");
return false;
}

if (x4 == "") {
alert("Would you input your Message?");
return false;
}




(8) Copy (7) and paste it your allpost-contactform.js, under the part of this:


/*
if (x3 == "") {
alert("Would you input your Address?");
return false;
}
*/



If you've done above, your allpost-contactform.js looks like below:



/*
if (x3 == "") {
alert("Would you input your Address?");
return false;
}
*/

if (x1 == "") {
alert("Would you input your E-mail address?");
return false;
}

if (x2 == "") {
alert("Would you input your Postal Code?");
return false;
}

if (x3 == "") {
alert("Would you input your Address?");
return false;
}

if (x4 == "") {
alert("Would you input your Message?");
return false;
}


 

お問い合わせ