Click to See Complete Forum and Search --> : Can't get two functions to work


copel0101
12-10-2002, 02:28 PM
Hi,
I am just starting out with simple java code. I can get either function to work by themselves, but I can't get both to work together.
<script language="javascript">
function ValidateForm(theForm)
{
var agree=confirm("Is everything correct?");
if (agree) return(true);

return(false);

theForm.x_NM.value=theForm.x_NM.value.toUpperCase();
return(true);
}

</script>
Any ideas? Thanks in advance.
JC

Ryan
12-10-2002, 03:48 PM
umm, it might just be me, but i only see one function.

copel0101
12-10-2002, 03:55 PM
I have tried it like this also without success

<script language="javascript">
function ValidateForm(theForm)
{
var agree=confirm("Is everything correct?");
if (agree) return(true);

return(false);
}
function ValidateForm(theForm)
{

theForm.x_NM.value=theForm.x_NM.value.toUpperCase();
return(true);
}

</script>

The scripts work when separated

<script language="javascript">
function ValidateForm(theForm)
{
var agree=confirm("Is everything correct?");
if (agree) return(true);

return(false);
}

</script>

and

<script language="javascript">
function ValidateForm(theForm)
{
var agree=confirm("Is everything correct?");
if (agree) return(true);

return(false);
}

</script>
But not together