If the validate function isn't doing much except working on specific objects
(document.tester.mytext.value), then there isn't much point in moving it to
its own function imo.

Example:




Mungbeans wrote:
> 
> Thank you, Karl.  This code now works well:
> 
>   $(document).ready(function() {
>       $("#sendmail").click( function() {
>         validate();
>       return false;
>       });
>   });
> 
> function validate() {
>       if ( document.tester.mytext.value == "" ) {
>               alert ('Your have not provided a mytext');
>       } else {
>           document.op.value = "Send";
>               document.tester.submit();
>       }
> }
> 
> Now the form works nicely with or without javascript.  
> 

-- 
View this message in context: 
http://www.nabble.com/Simple-form-setup-tf2187171.html#a6075616
Sent from the JQuery forum at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to