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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:20:35+00:00 2026-05-29T04:20:35+00:00

$(‘td.qid’).text(). The code above will determine which row the alert is refering to. Below

  • 0
$('td.qid').text(). 

The code above will determine which row the alert is refering to. Below is what the alert looks like:

You have not entered a valid Question 

Please Enter in the Number of Answers you Require for this question 

Please enter in a figure for Number of Marks for this Question 

I want the alert to look like below:

You have errors on question number: 1 

You have not entered a valid Question 

Please Enter in the Number of Answers you Require for this question 

Please enter in a figure for Number of Marks for this Question 

My question is that where do I put “You have errors on question number” and the code $('td.qid').text() in the function below to be able to display the ‘You have errors on question number: 1’ on the top of the alert?

Below is the validation function:

var qnum = 1; 

function insertQuestion(form) {   

    var $tbody = $('#qandatbl > tbody');  
    var $tr = $("<tr class='optionAndAnswer' align='center'></tr>"); 
    var $qid = $("<td class='qid'>" + qnum + "</td>"); 

$tr.append($qid); 
$tbody.append($tr);  

   $(form).find('.numberOfQuestions').val(qnum); 

    ++qnum; 
    $("#questionNum").text(qnum); 

} 

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-05-29T04:20:43+00:00Added an answer on May 29, 2026 at 4:20 am

    Let say your html page looks like this:

    > <html> <body> 
    > <table border="1" width="200">
    >     <tr>
    >         <td class='qid'>1</td> 
    >         <td>bla bla</td>
    >     </tr>
    >     <tr>
    >         <td class='qid'>2</td>
    >         <td>bla bla</td>
    >     </tr>
    >     <tr>
    >         <td class='qid'>3</td>
    >         <td>bla bla</td>
    >     </tr> 
    > </table> 
    > </body> </html>
    

    Then you add a jQuery code like this:

    $("tr").click(function(e){
        var _qid = $("td.qid", this).text();
        var _msg = "You have errors on question number:" + _qid ;
        alert(_msg );
    });
    

    By doing this you add a click event on every then pick the text of the column with the class qid and build your message.

    you can try it here: http://jsfiddle.net/franky/f956k/

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

Sidebar

Related Questions

I was writing code for dragging mechanism which invokes to wait for small period
I have a text area in my form which accepts all possible characters from
I would like to count the length of a string with PHP. The string
I've got a string that has curly quotes in it. I'd like to replace
I am trying to create a RegEx expression that will successfully parse the following
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT
I have a reasonable size flat file database of text documents mostly saved in
The problem with unsigned char. I am reading a PPM image file which has

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.