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 9145367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:29:46+00:00 2026-06-17T10:29:46+00:00

I work on an html form, which I need checked with javascript regex but

  • 0

I work on an html form, which I need checked with javascript regex but it is only working if I put in static text. I need the html form text(input data) to be checked against the regex.

I have searched for this around, but i can only find people showing examples with static text.

Fruther explanation:
I don’t need help for understanding the regular expressions.
I need to understand how to pass the data, which the user inputs – into the check against the regular expression.

    <script>
    function fn() {
    var x=document.getElementById("fname");
    xv=x.value.toUpperCase();

    var re = new RegExp("s", "g"); //Here is the expression i am searching for - This i do understand// 
    var result = re.test( ?? ); //Here should go the user input from ((("fname" - var x)))

    if (result == true) {
    var result = $("#result").empty();
    $.post('../search.php',{xv : xv},
    function(data){
    result.append(data);
    }

    if (result == false) {  
    var result = $("#result").empty();
    result.append("try again");
    }
    }
    </script>
  • 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-17T10:29:47+00:00Added an answer on June 17, 2026 at 10:29 am

    Do you mean:

        var re = new RegExp("s", "g");
      **var result = re.test(xv);**
        if (result == true) {
    
        }
    
        if (result == false) {  
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm taking 02/29/2012 from an html form, but will need to work with the
I have form in html where user can put the text in text area.
Possible Duplicate: Jquery trigger file input I'm working on a form which allows users
I'm loading form into jquery-ui dialog using jquery.html() function and then Submitting doesn't work
I am creating a regex library to work with HTML (I'll post it on
I have an html page called search.html which contains sliders, they work perfectly in
What is the best way to gray out text inputs on an HTML form?
I have a complex html-Form and am using jQ for some of the work
I have a HTML form which when submitted sends an email with all the
I need to supply an html form (not a server form) for searching within

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.