473,699 Members | 2,226 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help in integrating inline validation!!

pradeepjain
563 Contributor
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 2147
acoder
16,027 Recognized Expert Moderator MVP
Is there a need for both? One or the other is fine as far as I can see.
Sep 9 '09 #2
pradeepjain
563 Contributor
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 Recognized Expert Moderator MVP
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
2195
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" and every Request.Cookies i'm using ??? thanks
4
1546
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). Typically any dynamic use of writeToDiv, has given me an extra line and I'd like it to appear directly to the right of the I.fld I've tried to specify enough width for the <td> and even have a separate column for the <div>, but neither turned...
1
1362
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 decimel number that must have 2 decimel numbers after and only up to 7 digits before decimel. Thanks again
2
2695
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 same module but not if it is called from a second module i.e. extern inline. For example (extremely simplified), inline void Bob(void)
2
965
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 only, not textbox B, and when button B is clicked, the required validation will apply to textbox B only. How can I achieve this? for now when I click on button A, both textboxes A and B are validated.
5
1903
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 override void CreateChildControl() {
1
1494
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 codes are as follows: Below are the results of checking this document for XML well-formedness and validity. Error Line 7, column 9: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified . <p...
14
8008
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 xmlns="http://intranet/hstServices/Schemas/XmlCommand.xsd" connectionKey="SomeKey" commandTimeout="60" appId="122" appScreenType="879">
2
1099
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 the value is between 0% and 100%. I also need the macro to give the user a message if a mistake occurs (using MsgBox).... I've done the first part, using IsNumeric, but I can not figure out how to do the other instructions.. Please help me out, Close...
0
8689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8885
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7752
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2348
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.