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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:59:12+00:00 2026-05-12T10:59:12+00:00

I have a form (signup.php) that pops up in a nyroModal window when I

  • 0

I have a form (signup.php) that pops up in a nyroModal window when I click a button:

<input value="Edit" class="nyroModal" type="button" href="signup.php">

I would like to use some form of AJAX validation (to check if the user name has been taken, for example) before submitting the form.

I had the following in mind: When the user clicks the ‘submit’ button. it calls javascript function with onClick that sends the required fields to a PHP script, which returns whether the fields are valid. Then, if the field is invalid, it notifies the user, but when the field is valid, it submits the form via something like $('#formid').submit();. Easy enough in theory.

BUT

Problem is, when the nyroModel gets the new form from a URL, and creates a div in the DOM with the contents in it, Firefox completely ignores any <script> tags. Using Firebug, I can see it actually gets the <script> tags with the response, but Firefox ignores them. Also, I can’t create a jQuery function on the page that the model is called from, because when the document is created, the form doesn’t exist in DOM yet.

Any ideas how to solve this?

  • 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-05-12T10:59:13+00:00Added an answer on May 12, 2026 at 10:59 am

    Try adding a submit handler to the form:

    onClick='return frmSubmit()'
    

    In this handler, you first serialize the form’s data, and submit this to the validation script. Be sure to return false after issuing the request, as it is done asynchronously. In the response callback, you implement the following: if the response indicates that the input is valid, you programatically submit the form with the .submit()-method. If, however, the reponse indicates that something’s wrong (you’ll have to supply the feedback in JSON-format), attach some constructive feedback to the form for the user to read.

    Don’t forget to catch the keypress event, and prevent the form from being submitted when Enter is pressed, as it will bypass your validation function.

    And, uhm, one suggestion: it might be better to do all the validation on the client-side to start with, which is usually enough. You probably heard that client-side validation can be circumvented, so there is still a need for server-side checking. However, I always feel that if a user decides to mess with the system seriously, then it isn’t necessary to provide constructive feedback. A simple message indicating failure will suffice. So, first check the input with plain Javascript. If something’s wrong, provide feedback. If, however, the server receives invalid input (which means that the client-side validation has been bypassed), just notify the user that he failed.

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

Sidebar

Related Questions

I have a form here when you press Click To Test Signup : http://www.problemio.com/test.php
let's say I have index.php . It has a form that POSTS to signup.php
I have the form below in a PHP/HTML file: <form method=post> Username<input type=text size=12
I have signup form that posts all variables to signup.php. What I want to
I have a problem. The client is claiming that a prize signup form I
I have form area in my view. If I click button A , I
I have a simple signup form that needs to track number of hits from
I have a simple user signup form with a checkbox that lets users get
I'm working on an email series signup form that needs to have a checkbox
I have this function when I click on my submit button: $('#signup-button').click(function(event){ var username_check

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.