HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

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 ASP Free Forums Sponsor:
  #1  
Old October 15th, 2003, 03:56 AM
icepricessa's Avatar
icepricessa icepricessa is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 183 icepricessa User rank is Private First Class (20 - 50 Reputation Level)icepricessa User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 16 h 57 m 22 sec
Reputation Power: 6
checking the format function???

hi there i have a form field which i need to validate. this feild can accept numbers as well as this format e.g 1-2 and 1,2,3,4,5

how do i go about it?

Reply With Quote
  #2  
Old December 3rd, 2003, 03:22 AM
dev257 dev257 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Chandigarh
Posts: 55 dev257 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 48 sec
Reputation Power: 5
here's a sample html file

<html>
<head>
<script language="JavaScript">
function chk(wi)
{/*all the desired validation here and notify user using alert function .use substring method to find part of the string use win.form.t1.value as an argument*/
win.form.t1.value=""
}
</script>
<body>
<form name="f1" action="" method=post>
Form field<input type=text name=t1 on blur="chk(this)">
</form>
</body>
</html>



hope this helps you

Reply With Quote
  #3  
Old January 8th, 2004, 12:20 AM
shamrog12's Avatar
shamrog12 shamrog12 is offline
Newton's Apple Wizard
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 1,661 shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 2 h 39 m 22 sec
Reputation Power: 34
Send a message via AIM to shamrog12
Sounds like you'll want ot use regular expressions. It's a little complex unless you've used it before and become familiar. It's fun though. Here are a couple links:

http://www.regular-expressions.info/javascript.html
http://devedge.netscape.com/library...xp.html#1193136

Here you can test your work: http://reliableanswers.com/js/rxtest.asp
http://b-cage.net/irc/scripts/regexp.html

I may get motivated and try to see if I can figure it out for you

Reply With Quote
  #4  
Old January 8th, 2004, 12:49 AM
shamrog12's Avatar
shamrog12 shamrog12 is offline
Newton's Apple Wizard
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 1,661 shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 2 h 39 m 22 sec
Reputation Power: 34
Send a message via AIM to shamrog12
pattern = /(([0..9]),(-|\,))+/gi;

I haven't tested this at all but it might be along these lines.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > checking the format function???


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