I have a simple javascript function to validate a form (RSform!Pro in Joomla) on submit. Problem is bots are able to submit the form without the validate script running when they have javascript disabled. The only option I can think of to prevent this case from happening is to use php instead of javascript. Could someone help me with this conversion or offer an alternative?
function validateEntreeCount(theForm)
{
if (parseInt(document.getElementById('Attendees').value) !=
parseInt(document.getElementById('Beef').value) +
parseInt(document.getElementById('Chicken').value) +
parseInt(document.getElementById('Vegetarian').value))
{
alert('The total amount of attendees does not match the total amount of entrees selected');
return false;
}
else
{
return true;
}
}
Thanks for everybody's input!