BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Welcome to all the Students > Tutorial > How to ?


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 23-07-2011, 07:07 AM
.BZU.'s Avatar


 
Join Date: Sep 2007
Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute
Thumbs up How to Allow text box only for alphabets using Jquery

If you want to make the text box allow only alphabets (a-z) using Jquery. it is easy to do so...

HTML Code:
<input name="Texting" onkeyup="this.value=this.value.replace(/[^a-z]/g,'');">
OR for Smaller and Upper both cases


HTML Code:
<input name="First Name" type="text" id="fn" class="textbox" onkeyup="this.value=this.value.replace(/[^a-z,A-Z,.]/g,'');"/>
And can be the same to onblur for evil user who like to paste instead of typing

HTML Code:
<input name="lorem" class="alphaonly">
<script type="text/javascript">
$('.alphaonly').bind('keyup blur',function(){ 
    $(this).val( $(this).val().replace(/[^a-z]/g,'') ); }
);
</script>
You shouldn't use HTML attributes to attach events, especially when something as easy as jQuery is available to properly attach the event handler.
__________________
(¯`v´¯)
`*.¸.*`

¸.*´¸.*´¨) ¸.*´¨)
(¸.*´ (¸.
Bzu Forum

Don't cry because it's over, smile because it happened
Reply With Quote
Reply

Tags
alphabets, box, jquery, text


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Typography Text of Modern Art 25 Pictures .BZU. Designed Pictures 0 02-04-2010 04:24 AM
Teamwork.. Eng Alphabets in different style.. Raheel Designed Pictures 0 08-03-2010 01:39 PM
Read the text irfishahpk Chit Chat 2 22-03-2009 01:37 PM
Move text on disk top Aamir Tutorial 11 02-10-2008 02:04 AM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 08:24 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.