Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7846031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:26:36+00:00 2026-06-02T17:26:36+00:00

I am trying to use this script to validate a form: http://validator.codeplex.com/ I am

  • 0

I am trying to use this script to validate a form:
http://validator.codeplex.com/

I am trying to create an input field that has a default value: “First and Last Name”

<div class="RightForm"><input type="text" id="firstlastname" name="firstlastname"
value="First and Last Name" style="width: 175px; float:right;" validate="form" invalid=
"<b>First and Last Name missing</b><br/>Please enter your First and Last name." 
invalidVal="First and Last Name" /></div>

If the person clicks submit without changing that default value, I want the validation to show the script’s default pop up warning with the message “First and Last Name are required…” – Also, I don’t want the field to left empty. So the warning should show up for both cases.

However, right now the script is just showing “Undefined” as opposed to the error message.

Any thoughts on how I can fix? Thank you so much!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:26:37+00:00Added an answer on June 2, 2026 at 5:26 pm

    One thing that immediately stands out is this bit of code:

    invalid="<b>First and Last Name missing</b><br/>Please enter your First and Last name."
    

    If you use HTML syntax characters in HTML attributes, they must be escaped as entities or you will have broken HTML that javascript may not be able to understand:

    invalid="&lt;b&gt;First and Last Name missing&lt;/b&gt;&lt;br/&gt;Please enter your First and Last name."
    

    Needless to say, invalid is not a legal HTML attribute and this appears to be being used purely as a javascript hook.

    Also, instead of populating the value attribute, you should use placeholder instead:

    placeholder="First and Last Name"
    

    This will probably take care of the issue you’re having, as the field will not actually have a “value”, but the text will appear in the input if left empty.

    Aside: If you get fed up with the library you’re using, the de facto jQuery validation library is this one:

    • http://bassistance.de/jquery-plugins/jquery-plugin-validation/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use this script from Github at https://github.com/blueimp/jQuery-File-Upload The script has js
Trying to use this following script to load a page so that I can
I am trying use this example http://www.sajithmr.me/jrecorder/example2.html for recording audio and send it to
I am trying to use this plugin here to create a slider on my
Hello there i'm trying to create a form with Zend_Form that will enable my
I am trying to validate a form in that if there is no text
I wrote the following pre-commit script for SVN to validate that a user has
I am trying to use this jQuery script to make an image caption from
Hi I'm trying to use this script to return a value from another php
Trying to get this form to validate email using the function the professor said

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.