Having trouble with two simple JS functions? One checks the values of 2 input fields and triggers the other function. Check out the code below!
function ValidateForm()
{
var name = document.getElementById('fullname').value;
var email = document.getElementById('email').value;
if(name.value= '' || email.value='')
{
alert('fields Empty');
}
else
{
UpdateRecord();
}
}
function UpdateRecord()
{
var Qact = getQueryVariable('ACT');
if(Qact==2){
var picture= document.getElementById('myPic').src;
activity.setUpdates(name,email,picture);
}
else
{
activity.CheckEmail(name,email);
}
}
HTML
<button onClick="ValidateForm();" data-role="button" >Register</button>
Experiencing issues while calling UpdateRecord()
on button click? When using ValidateForm()
, nothing seems to work. The Firefox debugger doesn't even go into the ValidateForm()
function.