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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:26:20+00:00 2026-06-17T01:26:20+00:00

I have a table row which contains a button: <form id=’studentAddForm’> <table id=’removetbl’> <tr>

  • 0

I have a table row which contains a button:

<form id='studentAddForm'>
<table id='removetbl'>
<tr>
<td><button id='submitstudents'>Submit Students</button></td>
</table>
</form>

When the button is clicked, it displays a confirmation box, hoow come though when I click on the Cancel button with in the confirmation box does it still want to load the page? I am getting no errors in my page

Below is jquery code showing click event, confirmation and submit form:

function submitform() {    
    $.ajax({
        type: "POST",
        url: "updatestudentsession.php",
        data: { 
            sessionid:  $('#currentid').val(),
            students:   $('#addtextarea').val()
        },
        dataType:'json',  //get response as json
        success: function(result) {
            if(result.errorflag) {
                //do your stuff on getting error message
                var newHtml="<span style='color: red'>"+result.msg+"</span>"; 
                $("#targetdiv").html(newHtml);  //i am displaying the error msg here
            } else {
                //you got success message
                var newHtml="<span style='color: green'>"+result.msg+"</span>"; 
                $("#targetdiv").html(newHtml);
                $('#targetdiv').show();
            }
        }
    });        
}

function showConfirm() {
    var examInput = document.getElementById('newAssessment').value;
    if (editvalidation()) {
        var confirmMsg=confirm("Are you sure you want to add your selected Students to this Assessment:" + "\n" + "Exam: " + examInput);
         if (confirmMsg==true) {
             submitform();
         }
     }
 } 

 $('body').on('click', '#submitstudents', showConfirm);  

UPDATE:

I don’t know if the information below will help you even further but below shows all of the forms in the page:

FORM 1:

$assessmentform = "<div id='lt-container'>
<form action='".htmlentities($_SERVER['PHP_SELF'])."' method='post' id='assessmentForm'>
<p id='warnings'>{$pHTML}</p>
{$outputmodule}
<p><strong>Assessments:</strong> {$sessionHTML} </p>   
</form>";

echo $assessmentform;

FORM 2:

$editsession = "
<form id='updateForm'>

    <p><strong>Assessment Chosen:</strong></p>
    <table>
    <tr>
    <th></th>
    <td><input type='hidden' id='currentId' name='Idcurrent' readonly='readonly' value='' /> </td>
    </tr>
<tr>
<th>Assessment:</th>
<td><input type='text' id='currentAssessment' name='Assessmentcurrent' readonly='readonly' value='' /> </td>
</tr>
    </table>
    <div id='currentAlert'></div>
";

echo $editsession;

FORM 3:

    $studentexist="
    <form id='studentExistForm'>
    <p><strong>Current Students in Chosen Assessment:</strong></p>
    <p>{$studentSELECT}</p>
    </form> 
    </div>";

echo $studentexist;

FORM 4:

    $studentremain="<div id='rt-container'>
    <form id='studentRemainForm'>
    <p>{$remainSELECT}</p>
    <table id='addtbl'>
    <tr>
    <td><button type='button' id='addbtn'>Add</button></td>
    <td><button type='button' id='addall'>Select All</button></td>
    <td><button type='button' id='adddeselect'>Deselect All</button></td>
    </table>
    </form>";

echo $studentremain;

FORM 5:

$studentadd="
<form id='studentAddForm'>
<p>{$addSELECT}</p>
<table id='removetbl'>
<tr>
<td><button id='submitstudents'>Submit Students</button></td>
</table>
</form>
</div>";

echo $studentadd;
  • 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-17T01:26:21+00:00Added an answer on June 17, 2026 at 1:26 am

    Try using this:

    if (confirmMsg){
         submitform();   
     }else{
         return false;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table in in which every row contains a form. see below
Ok, I have a table which contains multiple rows. Each row contains some data
I have a table which is being dynamically populated, each row contains two textfields
I have a table which contains delete buttons for each row. I use int
I have a static Html Table which contains one button Add and when clicking
I have a table form which contains a part where the rows can be
I've got a FORM which contains a 32*50 TEXTAREA and a Submit button. Now
I have created a table layout in which my table row height is too
I'm having a table and i have a row which is initially set to
I have a DB table in which each row has a randomly generated primary

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.