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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:03:05+00:00 2026-06-16T13:03:05+00:00

Trying to load a custom form submisson error box in Facebox, when testing around

  • 0

Trying to load a custom form submisson error box in Facebox, when testing around with some code im having trouble getting .append() to append more than one time. If both of the example errors are failed its only loading appending and loading one in to the facebox, but if one at a time is failed it will show the correct one that is supposed to display, just not both at once..

Sorry if the code is messy / not efficient, javascript isn’t my strong suit.

  $('#signup').submit( function() {
 var fname = $("#fname").val();
 var lname = $("#lname").val();
 var uname = $("#username").val();
 var pass = $("#password").val();
 var passc = $("#passwordc").val();
 var email = $("#email").val();                   

 if(/^[a-zA-Z0-9_]*$/.test(uname) == false) {
           //alert('Usernames can be alphanumeric but may include an underscore.');
       $("#errorholder").append('<tr><td style="margin: 0;">Usernames can be alphanumeric but may include a underscore.</td></tr>');
 }
 else if(/^[a-zA-Z']*$/.test(fname) == false) {
      //alert('First name may not contain numbers or symbols.');
      $("#errorholder").append('<tr><td style="margin: 0;">First name may not contain numbers or symbols</td></tr>');
 }
 else if(/^[a-zA-Z']*$/.test(lname) == false) {
      //alert('Last name may not contain numbers or symbols.');
 }
 else if(!$("#fname").val()){
      //alert('First name required');
 }
 else if(!lname){
      //alert('Last name required');
 }
 else if(!uname){
      //alert('Userame required');
 }
 else if(pass!=passc){
      //alert('Passwords don\'t match');
 }
 else if(pass.length<5){
      //alert('Password must be at least 5 characters.');
 }
 else if(!email){
      //alert('Email required');
 }  
 else if (!$("input:radio[name='gender']:checked").val()) {
          // alert('Please select gender.');
 }
 jQuery.facebox({ div: '#piksplay' });
 return false;

  });
});
  • 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-16T13:03:06+00:00Added an answer on June 16, 2026 at 1:03 pm

    You’re trying to test multiple conditions, but you’re using else if. As soon as your code find a true condition then it doesn’t test anything else, so only one append will get fired each time. These all need to be separate if statements.

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

Sidebar

Related Questions

I'm getting a cross domain error when trying to load a custom class. Here
hi I'm trying to load up a html file via a Custom Alert box,
While trying to load custom templtetags, I got error 'myapp' is not a valid
I'm trying to load some custom XML data into an Android application, so I
Trying to load some XML into a document: <Custom AttributeA='' AttributeB='Bob' AttributeC='HUNTERS' COMPANY EMPLOYEES'
I'm trying to load a custom workflow activity onto a crm server. I loaded
I'm trying to load image from a plist to a custom cell. It all
i m trying load UIImages from server asynchronously in UITableViewCell. My code worked fine
I'm trying to load a custom cursor from a resource file (.rc) in Visual
I am trying to load UIActivityIndicatorView custom class, however, I am trying to embed

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.