Hello,
I am just starting with Javascript, (I do program in other languages). I am trying to capture the situation where a user does not enter either a Primary or Secondary phone. This is on a Submission page. I inspected the items and it had EditRecordPrimaryPhone on the page .I also tried InsertRecord, but nothing works. It doesn't look like the page is running the Javascript at all, and I don't know how to debug it. I added a message that I hoped I would see either way to try to check that the Javascript was running. I put the code in the Footer. Are there ways of debugging?
Thanks
Tonie
<SCRIPT LANGUAGE="JavaScript">
function checkPhones(){
var p1 = document.getElementById("EditRecordPrimaryPhone").value;
var p2 = document.getElementById("EditRecordSecondaryPhone").value;
if(p1 == "" && p2 == ""){
{
window.alert('Please input at least one phone number');
return false;
}
else
{
window.alert( p1 + '' + p2);
return false;
}
}
}
document.getElementById("caspioform").onsubmit=checkPhones;
</SCRIPT>