<%
function checkValue(str) {
if (typeof(str) == "undefined" || str == "null") {
return "";
}
else {
var s = new String(str);
if (s == "undefined")
return "";
return s.toString();
}
}
var cmd = Request.QueryString("cmd");
if (cmd == "comfirm")
{
ShowForm();
}
else if (cmd == "success")
{
Response.write(" Your enquiry request has been submitted!");
}
else if (cmd == "reg")
{
comp = checkValue(Request.form("comp"));
add1 = checkValue(Request.form("add1"));
add2 = checkValue(Request.form("add2"));
phone = checkValue(Request.form("phone"));
email = checkValue(Request.form("email"));
respon = checkValue(Request.form("respon"));
if (comp.length == 0 || phone.length < 7 || email.length == 0 || respon.length == 0) {
Response.write(" Please fill all the required fields correctly.");
ShowForm();
}
else
{
PostForm();
}
}
else
{
comp = checkValue(Request.form("comp"));
add1 = checkValue(Request.form("add1"));
add2 = checkValue(Request.form("add2"));
phone = checkValue(Request.form("phone"));
email = checkValue(Request.form("email"));
respon = checkValue(Request.form("respon"));
if (comp.length == 0 || phone.length < 7 || email.length == 0 || respon.length == 0) {
Response.write(" Please fill all the required fields correctly.");
ShowForm();
}
else
{
PostForm();
}
}
function ShowForm() {
comp = checkValue(Request.form("comp"));
add1 = checkValue(Request.form("add1"));
add2 = checkValue(Request.form("add2"));
phone = checkValue(Request.form("phone"));
email = checkValue(Request.form("email"));
respon = checkValue(Request.form("respon"));
%>
<% }
function PostForm() {
comp = checkValue(Request.form("comp"));
add1 = checkValue(Request.form("add1"));
add2 = checkValue(Request.form("add2"));
phone = checkValue(Request.form("phone"));
email = checkValue(Request.form("email"));
respon = checkValue(Request.form("respon"));
%>
<% } %>
|
|