XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 13th, 2003, 02:19 PM
securitypro securitypro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Florida
Posts: 6 securitypro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Verifying format of entered phone number

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>
<xsltherwise>
<xsl:value-of select="acct_mph"/>
</xsltherwise>
</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>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Verifying format of entered phone number


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT