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

The Archive Base Latest Questions

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

I have a jsfiddle here http://jsfiddle.net/cbyJD/74 The problem I am having is that it

  • 0

I have a jsfiddle here http://jsfiddle.net/cbyJD/74

The problem I am having is that it is not displaying the question number in the alert but instead displays NaN. Also even though all the text inputs have been filled in, it still displays an alert stating have I have an empty text input.

What am I doing incorrectly in my fiddle?

Jquery validation() function is here:

function validation() {

        var alertValidation = "";
        var _qid = "";
        var _msg = "";

        $("[class*='q']").each(function(i) {  
        var questions = parseInt($("[class*=q" + i + "_qnum]").text());
        var marks = parseInt($("[class*=q" + i + "_ans_text]").text()); 
        var txtinput = $("[class*=q" + i + "_mark]").val(); 
        _qid = questions;
        _msg = "You have errors on Question Number: " + _qid + "\n";


    if (txtinput == '' || txtinput == null) {
        alertValidation += "\n\u2022 You have not entered in a value for all the Indivdiaul Marks textbox\n";
    }    

                if (alertValidation != "") {
                    return false; //Stop the each loop 
                }

            });


        if (alertValidation != "") {
            alert(_msg + alertValidation);
            return false;
        }

        return true;
    }
  • 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-15T13:03:22+00:00Added an answer on June 15, 2026 at 1:03 pm

    the value here is $(“[class*=q” + i + “_qnum]”) empty, the web can’t find the class as you want, class=”q0_qnum” for when your “i” is 0

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

Sidebar

Related Questions

I have a jsfiddle here: http://jsfiddle.net/aND4g/2/ I am having a problem with a text
I have the following problem: http://jsfiddle.net/DerNa/12/ Which is demonstrated more clearly the jump here:
To explain my question I have created this http://jsfiddle.net/Jams/XNVB2/ here I want when div1
I have a jsfiddle here: http://jsfiddle.net/ybZvv/22/ The situation I have is that if you
I have a jsfiddle here to illustrate my question http://jsfiddle.net/ttmt/DgnLd/1/ It's just a simple
I have a jsfiddle here http://jsfiddle.net/cbyJD/76 As you can see in the fiddle there
I have the problem built into a jsfiddle here: http://jsfiddle.net/XRdTD/ If you select something
I have a jsfiddle here : http://jsfiddle.net/hhimanshu/eLhLS/1/ Current: On keypress, it keeps on appending
I have a fiddle here - http://jsfiddle.net/hhimanshu/SDr3F/2/ The left pane is already available I
I have a fiddle here http://jsfiddle.net/WULsZ/1/ I load jQuery first and the code is

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.