Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2008, 08:34 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default JavaScript textarea problem with FireFox

Hello Everyone,
   I have been tolling over this for sometime now and I can't seem to find anything on google that pertains to this.

The long and the short of this is I have a form that has a single TEXTAREA contained within a hidden div. Based upon some logic this div is shown to the user with a value inserted into the TEXTAREA via javascript.

Now, there is a JavaScript wired up to the submit button that validates the TEXTAREA that it contains a comman sepearated list of email address's. The issue I am having is that, again based on some logic, the TEXTAREA may be prepopulated with a value via javascript. In IE if the user does not add any further text to the TEXTAREA and presses submit the javascript validates the information and process's the page as expected. In FireFox, however, the Javascript validation fails because it detects that the TEXTAREA is empty!

If the user types a single keystroke into TEXTAREA everything validates in FireFox without fail but, it seems FireFox is readining the TEXTAREA as having an empty value.

Here is my Javascript that I use, nothing real fancy:
Code:
    function CheckBulkEmail()
    {
       var emailList = document.getElementById('<%=txtMultiEmail.ClientID %>').value;
       var emailArray = emailList.split(',');
       var regPattern =/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;

       for(i=0; i!=emailArray.length;i++)
       {
           if(!regPattern.test(emailArray[i].trim()))
           {
             alert('The email address ' + emailArray[i] + ' is invalid. Please correct it before continuing!');
             return false;
           }
       }
       return true;
    }
Thanks!

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox vs. IE - Javascript problem VerbatimBOT ASP.NET 2.0 Professional 2 September 25th, 2008 03:28 AM
stop horizontal scrolling in textarea in Firefox 2 crmpicco CSS Cascading Style Sheets 1 October 13th, 2007 05:24 PM
Javascript - Firefox is not supporting lakshmi252002 General .NET 0 April 17th, 2007 12:14 AM
Firefox javascript error akkad Ajax 2 November 27th, 2006 10:57 AM



All times are GMT -4. The time now is 01:45 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.