User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 423,347 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,214 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 524 | Replies: 1
Reply
Join Date: Dec 2007
Posts: 355
Reputation: OmniX is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
OmniX's Avatar
OmniX OmniX is offline Offline
Posting Whiz

Javascript - Validation

  #1  
May 28th, 2008
Since no one is able to help me textfield validation in firefox.
I will start again from my roots and hopefully come up with a solution!

Now there are several ways of validating text fields using javascript.
I would like to know ALL of them and ill test which work for my problem.

So if you all could give small examples of restricting input to only text or numbers or any characters.

Then I can work from that and hopefully come up with a solution.

Thankyou, Regads X
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 117
Reputation: Thirusha is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 13
Thirusha Thirusha is offline Offline
Junior Poster

Re: Javascript - Validation

  #2  
May 28th, 2008
you can go here http://articles.techrepublic.com.com...1-1044655.html

There are loads of other examples i just googled "restricting input to only text " and that is where i found the above link

I used regular expressions to prevent the user from entering non-numeric characters:
function checkNumeric(entry)
    {
        var numeric = /^[0-9]*$/; 
        if (!numeric.test(entry.value)) 
            {
               document.getElementById('errorText').style.display = '';
            }else{
                    document.getElementById('errorText').style.display = 'none';
            }
        entry.value = entry.value.replace(/[^0-9]/g,"");
    }
Last edited by Thirusha : May 28th, 2008 at 10:37 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:50 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC