|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi!
I am calling a javascript from this xsl snippet that the entered telephone number is in a certain format: 123-456-7890 I would like the code to be called when the user goes to the next field. Any ideas why this does not work? Chuck <td align="center"> <xsl:choose> <xsl:when test="$aspemail != 'true'"> <INPUT maxLength="13" name="priphone" size="13" onfocus="doSubmit=false;" onblur="checkphone(this);" value="{acct_mph}"/> </xsl:when> <xsl therwise><xsl:value-of select="acct_mph"/> </xsl therwise></xsl:choose> </td> Javascript in calling asp page: <script language="JavaScript"> <!--// var doSubmit = true; function checkPhone(fld) { if( (fld.value != "") && (/[0-9]{3}-[0-9]{3}-[0-9]{4}/i.exec(fld.value) > -1) ) { doSumbit = false; window.alert("The phone number must be in this format: 123-456-7890.\n"); fld.focus(); } else { doSubmit = true; } } //--> </script> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Verifying format of entered phone number |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|