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

  • Home
  • SEARCH
  • 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 8851323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:07:39+00:00 2026-06-14T13:07:39+00:00

I tried to write a regular expression to work with the position-absolute jQuery validation

  • 0

I tried to write a regular expression to work with the position-absolute jQuery validation plugin to give error if the string is left empty OR its a invalid URL. It works well for the URl but doesn’t give error if a empty string is there . Here’s the regex

 "regex": /^\S$|^(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}[\.]{0,1}/,

Can somebody tell what’s wrong in the regex?

EDIT:

I’m using this plugin for jQuery validation

Demo: Go to this URL and in the URL validtion section, remove HTTP and see the error messages

http://www.position-relative.net/creation/formValidator/demos/demoValidators.html

When I add required and URL validators together, it shoots 2 errors. But with only URL
validator, it doesn’t say that its a Invalid URL. I just need 1 error for both Empty and
Invalid URL.

https://github.com/posabsolute/jQuery-Validation-Engine

Thanks

  • 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-14T13:07:41+00:00Added an answer on June 14, 2026 at 1:07 pm

    You can set the same generic error message for all errors using data-errormessage, so regardless of whether the field is empty or has an invalid value you will get the same message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to write a .NET Regular Expression which validates if a string is
I'm trying to write a regular expression that will check so a given string
I'm trying to write a regular expression to mach an IRC PRIVMSG string. It
I'm trying to write a regular expression for Java's String.matches(regex) method to match a
I need to write a regular expression that will match everything in the string
I'm trying to write a regular expression which will match a string. For simplicity,
I am currently trying to write a regular expression to pull links out of
I need a regular expression to validate string with one or more of these
I am wondering if there is a specific regular expression I can write to
I want to write a regular expression to parse this webpage(view-source:http://www.imdb.com/search/title?title=spiderman&title_type=feature). Basically I want

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.