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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:27:07+00:00 2026-05-21T14:27:07+00:00

Here is my scenario, I present the user with a table of tests, which

  • 0

Here is my scenario, I present the user with a table of tests, which I have retrieved from my database in a loop and created a form for each test(row of table). So each has a submit button to execute that particular test.

basics of my loop:

while ($ts = mysql_fetch_assoc($test_info))
{
 //PRESENT VALUES $ts['name'] in table within a unique form etc.
}

What I am trying to do and failing is, on clicking a particular submit button for a test, to run a JS function which checks; if the test has a password attached, if it does, present a popup form for password input, and on submitting that small form check if password is correct, if it is submit the original test form.

My problem is that I cannot parse the password value attached to that form to my javascript.

so ideally i want to do this:

<input id='submit' type='button' onclick='JSfunction(test_password)' value='execute test' >

So I can somehow parse a value from that particular form to a javascript function without actually submitting the form.

and I believe I know how to do the rest in my JSfunction.

I hope somebody can follow my poor explanation and point me in the right direction.

Many 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-21T14:27:08+00:00Added an answer on May 21, 2026 at 2:27 pm

    When a form should have a password associated with it, add the following:

    <input type="hidden" name="has_password" value="yes" />
    <input type="hidden" name="password" value="" />
    

    Then, in your check triggered by the submit button (assuming the button itself is the this context):

    if ($(this).parent().find(':input:hidden[name=has_password]').val() == 'yes') {
        // pop password request
        return false;
    }
    

    You’ll need a way to store the context of the current form, and I can suggest a few if you like, but you can then populate the password into the hidden field for it and submit as normal. By the way, you might want to consider onSubmit instead of the submit button’s onClick, as onSubmit will catch attempts by scripts to perform a submit. If you do this, just remove the .parent() portion of the above, as the <form> element should be the this context.

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

Sidebar

Related Questions

Here is my scenario: I have table A, that has 4 rows (id, col1,
Here is the scenario. A user fills out a form. He forgets some required
Tackling a strange scenario here. We use a proprietary workstation management application which uses
here is the scenario 1: user starts to type some word, autocomplete engine shows
Here's my scenario - I have an SSIS job that depends on another prior
Here is the scenario that I have. I have a cvs repository in one
Here's the scenario: You have a Windows server that users remotely connect to via
Here's the scenario: I have a textbox and a button on a web page.
Imagine the following scenario. I have a checkbox that the user can check to
In this simplified scenario, I have a model called Post Each post has a

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.