![]() |
|
|
|||||||
| Javascript and Ajax Questions and information about working with Ajax and Javascript in Delphi for PHP. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
//Class definition
class Form_IDRetriever extends Page { public $vLinkBtn = null; public $vSendBtn = null; public $vEMail = null; public $vPasswordPanel = null; public $Label1 = null; public $Label2 = null; function Form_IDRetrieverJSLoad($sender, $params) { ?> //Add your javascript code here {document.getElementById('vEMail').focus();} <?php } function Form_IDRetrieverJSSubmit($sender, $params) { ?> //Add your javascript code here function validate_email(field,alerttxt) { with (field) { apos=value.indexOf("@"); dotpos=value.lastIndexOf("."); if (apos<1||dotpos-apos<2) {alert(alerttxt);return false;} else {return true;} } } //------------------------------------- { if (findObj('vEMail').value=='') {alert("Please enter a Email Address"); document.getElementById('vEMail').focus(); return(false);} else if (validate_email($this->vEMail,"Not a valid e-mail address!")==false) {$this->vEmail.focus(); return(false);} } <?php } } Is this the correct way to create a function call validate_email? Thank you |
| Sponsored Links |
|
|