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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:40:41+00:00 2026-05-14T06:40:41+00:00

I have a form that has two buttons on it, one yes, one no,

  • 0

I have a form that has two buttons on it, one yes, one no, and at the moment I capture the clicked button into a database, but for some reason, it doesn’t always capture the clicked button, I have gone through all my code and everything seems fine, here is the form

            <div id="mid_prompt">
            <form  action="refer.php" method="post" onsubmit="return submit_form()" >
            <div class="prompt_container" style="float: left;">
                    <span class="prompt_item"><input type="image" src="images/yes.jpg" alt="submit" name="refer" value="yes" /></span>
            </div>
            </form>

            <form action="thank_you.php" method="post" onsubmit="return submit_form()" >
            <div class="prompt_container" style="float: right;">
                    <span class="prompt_item"><input type="image" src="images/no.jpg" alt="submit" name="refer" value="no" /></span>
            </div>
            </form>
        </div>

I am using sessions to carry the variables all the way to the end of the forms where I then write all the data to a database, I have checked my sessions and they seem to be working fine, the only one that is giving problems is the yes/no.

So basically I need it to capture that yes/no everytime.

Thanx in advance!

  • 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-14T06:40:41+00:00Added an answer on May 14, 2026 at 6:40 am

    It will fail to capture this button press if someone hits “enter” to submit the form. If this is a data item, it would be better to capture it in a different way to be honest, as this only works when someone clicks the button or focusses the button before hitting enter.

    Hitting enter to submit a form is default behaviour for browsers, albeit with a few variations based on form size and field type (for example, a textarea will not submit on enter, but an input type=”text” will submit on enter).

    Perhaps add a check-box to capture this data item.

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

Sidebar

Related Questions

How do you change the JavaScript that will execute when a form button is
I have a mechanize script written in python that fills out a web form
Simple setup: Shopping Cart in the form of a data list. Header has two
I have a simple form that lists user names and for each user, the
We have an administrative portal that our teachers constantly forget to download their latest
Sorry for the wall of text guys but this one requires expliaining, way too
Ok, this is bugging me, and I just can't figure out what is wrong...
I am in the process of migrating a VB6 app to .Net and we
In this question I am looking for links/code to handle an IList<OrderLine> in an

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.