[Zope] validation-onClick

2000-11-23 Thread Angietel



The form="a" and its input field="custid" is being 
validated,when the alert message box came outtheni clicked on 
the 'OK' button which is inside the alert message box, but it return to another 
page insteadreturn to form="a".
( Ipreferto use 'onClick' 
insteadof 'onSubmit' )

The following is my JavaScript validation 
function:-

function 
checkid(){if(document.a.custid.value==""document.a.custname.value==""){alert("You 
must specify string character either in customer id or customer 
name.")document.a.custid.focus();return 
false;}}


The form events:-

input type="SUBMIT" name="Search" 
value="Search"  



Re: [Zope] validation-onClick

2000-11-23 Thread Stefan H. Holek

On Thu, 23 Nov 2000, Angietel wrote:

 The form="a" and its input field="custid" is being validated, when the alert message 
box came out then i clicked on the 'OK' button which is inside the alert message box, 
but it return to another page instead return to form="a".
 ( I prefer to use 'onClick' instead of 'onSubmit' )

this is a good choice! onsubmit gives you troubles with some browsers.

 input type="SUBMIT" name="Search" value="Search" onClick="JavaScript:checkid()"  

make this ... onclick="javascript:return checkid();"

Regards,
Stefan


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )