Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Form validation


Message #1 by "Shaukat Desai" <shaukat.desai@g...> on Fri, 6 Oct 2000 11:57:58 +0100
The correct syntax for multi-condition if is:

if (conditionA  &&  conditionB)
{
}
You have an extra if and more parens than necessary.
In particular, remove the if in the middle and the closing paren (')') to
the left of it and remove the opening paren ('(') to the right of the if.

=======>
Hi,

Is it possible for you to have a look at this JavaScript problem for me,
I'm having difficulty finding the error in the syntax.

<SCRIPT LANGUAGE="JavaScript">
<!--
// SubmitAction is called when the Submit button is pressed.

function SubmitAction()
{
  form = document.frmInvoiceSearch;
  if
(form.cboInvoiceCurrency.options[form.cboInvoiceCurrency.selectedIndex].valu
e
!= '') && if (document.frmInvoiceSearch.txtInvoiceAmountFrom.value == '')
  alert("Please type in an Invoice Amount From and To");
  
  else
  alert("Everything is fine"); 	
}
//-->
</SCRIPT>


  Return to Index