当有人成功注册我的一个网站时,我想显示一个弹出窗口。有数据正在写入外部数据库(这可以正常工作),所以我有点不确定我可以更改哪些代码部分以及哪些需要保留。如果你们中的任何人能够就此提出建议,那就太好了!说到javascript,有点菜鸟!
提前致谢
<form name="signup" id="signup" action="http://creationonline.co.uk/signup.ashx" method="post" onsubmit="return validate_signup(this)">
<input type="hidden" name="addressbookid" value="1232079">
<!-- UserID - required field, do not remove -->
<input type="hidden" name="userid" value="81918">
<!-- ReturnURL - when the user hits submit, they'll get sent here -->
<input type="hidden" name="ReturnURL" value="">
<!-- Email - the user's email address -->
<table border="0" cellpadding="0">
<tr>
<td> Sign up
</td><td><input name="Email" type="text" placeholder="Email Address" size="29"></td>
<td align="left"><input type="Submit" name="Submit" class="su_btn" value=">"></td>
</tr>
</table>
</form>`
<!--
function validate_signup(frm) {
var emailAddress = frm.Email.value;
var errorString = '';
if (emailAddress == '' || emailAddress.indexOf('@') == -1) {
errorString = 'Please enter your email address';
}
var els = frm.getElementsByTagName('input');
for (var i = 0; i < els.length; i++)
{
if (els[i].className == 'text' || els[i].className == 'date' || els[i].className == 'number')
{
if (els[i].value == '')
errorString = 'Please complete all required fields.';
}
else if (els[i].className == 'radio')
{
var toCheck = document.getElementsByName(els[i].name);
var radioChecked = false;
for (var j = 0; j < toCheck.length; j++)
{
if (toCheck[j].name == els[i].name && toCheck[j].checked)
radioChecked = true;
}
if (!radioChecked)
errorString = 'Please complete all required fields.';
}
}
var isError = false;
if (errorString.length > 0)
isError = true;
if (isError)
alert(errorString);
return !isError;
}
//-->