473,378 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

need help in integrating inline validation!!

pradeepjain
563 512MB
I am using a form which does inline validation using jquery!

http://yensdesign.com/2009/01/how-va...ng-php-jquery/

and i saw another inline validation method

http://www.exploremyblog.com/html/bl...php?blogid=301

i tried to integrate the pop up error which exits in 2nd one to 1st one but failed as i am new to jquery ! Can some one tell me how to do it as the 2nd code is bit complex to me . :(


Expand|Select|Wrap|Line Numbers
  1. function validateEmail(){
  2.                 //testing regular expression
  3.                 var a = $("#email").val();
  4.                 var filter = /^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/;
  5.                 //if it's valid email
  6.                 if(filter.test(a)){
  7.                         email.removeClass("error");
  8.                         emailInfo.text("Valid E-mail please, you will need it to log in!");
  9.                         emailInfo.removeClass("error");
  10.                         return true;
  11.                 }
  12.                 //if it's NOT valid
  13.                 else{
  14.  
  15.                         email.addClass("error");
  16.                         emailInfo.text("Stop cowboy! Type a valid e-mail please :P");
  17. promptText = "Valid E-mail please, you will need it to log in!";
  18. buildPrompt(promptText);
  19.                         emailInfo.addClass("error");
  20.                         return false;
  21.  
  22.                 }
  23.         }
  24.  
If i can make the code something like highlighted bcos already the validation is being done!
Sep 9 '09 #1
3 2134
acoder
16,027 Expert Mod 8TB
Is there a need for both? One or the other is fine as far as I can see.
Sep 9 '09 #2
pradeepjain
563 512MB
I wanted to integrate the second one for ma testing needz!! i did not succeed ! so asked for help :)
Sep 10 '09 #3
acoder
16,027 Expert Mod 8TB
If you do want to integrate them, in terms of code they both work very differently. For the second one, you need to set special classes which the code looks at to determine the rules to apply. You will also need to set your regex rules in the code (near the top - see the code comments).
Sep 10 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Hernán Castelo | last post by:
should i to validate all the "Request"s calls like Request.FORM("...") and Request.Cookies("...") ???? if it is so, i have to see inside every "Input" elements like "Text" and even "Hidden"...
4
by: invinfo | last post by:
I'm trying to make the most of my validation routine, and print out user friendly messages. I've got a nice writeToDiv function and I'm trying to make the messages look good (not wrap around). ...
1
by: Danny | last post by:
What can I enter into the validatioon rule property for a bound text box that points to a field. the field is text and will stay that way. how can I force the user to enter either nothing or a...
2
by: evan | last post by:
Hi, I've got an easy one... I need to inline a few functions from one module to another. By looking at the compiled code I can see that the function is inlined if it is called from within the...
2
by: hn | last post by:
Hi , On one page I have: - textbox A and button A, - textbox B and button B, All in one form. I want it to work this way: when button A is clicked, required validation will apply to textbox A...
5
by: Lloyd Dupont | last post by:
On my page the user is ask to set of question. Say there I have 2 controls like that == pseudo-C#-code for my control == class MyControl : CompositeControl { TextBox text; LinkButton button ...
1
nd21402
by: nd21402 | last post by:
I created a page and I have tried to validate numerous times with no success. My page is still showing 3 errors... I have been working on these for hours and I can really use some help.. The...
14
by: Doug | last post by:
Hi, I am trying to use a validation method against this xml and keep getting 'The 'name' attribute is not declared' and I can't figure out why. Here is my XML: <XmlCommand...
2
by: brokkoli88 | last post by:
Hi! I am having sort of a problem with a school assingnment. I need to create a macro that checks if the content in a cell is a number. If the value is a percentage, I need the macro to check if...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.