Forums

The code in the field "It Submit code - before Sending email

pelucre 18 Aug, 2010
Hello

After creating an item and having to insert an article with the plugin, I inserted the following code in the field "It Submit code - before Sending email:" of "Form: Code"

<script type="text/javascript">

function verif() {
var isVal = false;

for (idx in aDesc=document.body.getElementsByTagName('input'))
	if (aDesc[idx].type=='checkbox' && aDesc[idx].checked== true)
		{
		isVal = true;
		}
	if (isVal == false) 
		{
		alert('Veuillez choisir un des loisirs');
		return false;
		}
	else
		{
		return true
		}
}
</script>


But that function, is not executed under when submit the form.

What should I change to this code is executed?

Thank you in advance for your help
GreyHead 19 Aug, 2010
Hi pelucre ,

What do you want the script to do? JavaScript will only work in the browser; the OnSumit code is executed on the server after the form submits so needs to be in PHP.

Bob
This topic is locked and no more replies can be posted.