www.webdeveloper.com
Results 1 to 3 of 3

Thread: Validation

  1. #1
    Join Date
    Nov 2013
    Posts
    1

    Validation

    How could I show a validation error for a text field of a form even before pressing submit button, using ajax ?
    As shown below.
    Capt.PNG

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    if you post some code somebody would help you i believe
    Last edited by Padonak; 11-11-2013 at 08:13 AM.
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,346
    You wouldn't use AJAX directly as you are not sending data anywhere.

    You would use JavaScript to test an input field, using the HTML tag elements onblur to trigger an event when the user moves away from that text input to then call a function that checks the input, the use of onfocus to set the onblur event up can also allow you to ensure that the field is empty or to place any data generated by the page in to that field.

    The advice so far has been to ask you to post some code that you have created already and when you do, remember the forum tags to wrap the code, these are buttons available in the advanced editor and also in the quick reply window but you can just as easily use them directly, Eg...

    [ HTML ] ... code here [ /HTML ] (without the spaces) same applies to CODE and PHP tags. If you mess up, you have a short window of time to edit your post.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles