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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:02:08+00:00 2026-06-15T01:02:08+00:00

I need to have two inputs with a different types : <input type="button" **onclick

  • 0

I need to have two inputs with a different types:

<input  type="button"  **onclick = "?????"**   name="back"  value="&#8592 Back"  >
<input  type="submit" name="submit" value="Forward &#8594"  >

How can I do for type=button run this PHP code:

<?php

    if (isset($_POST['back']))
    {

        $_SESSION['onpage'] = $_SESSION['onpage'] - 1;

        $query_questionset = "
        select Q.Constructor AS Constructor,
        QS.QuestionIDFKPK AS QuestionIDFKPK,
        Q.QuestionValue AS QuestionValue,
        QS.SortOrder AS SortOrder,
        QS.onpage AS onpage
        from tbluserset AS US
        inner join tblquestionset AS QS ON US.QuestionSetIDFKPK = QS.QuestionSetIDPK
        inner join tblquestion AS Q ON QS.QuestionIDFKPK = Q.QuestionIDPK
        where (US.UserIDFKPK = " . $UserId . ")
        and (US.UserSetIDPK= '" . $_SESSION['UserSetIDPK'] . "')
        and (QS.onpage = '" . $_SESSION['onpage'] . "')
        order by QS.SortOrder";

    }

    $QuestionSet_Constructors = mysql_query($query_questionset);
?>

My form and input submit works perfectly:

<form id= "formID"  class="formular"   method="post" action= "<?= $url = "QUESTIONAREnewdatabase.php"; ?>" accept-charset="utf-8">

What I need on input type=button for run that PHP code and the action form like if Back had type=submit?

  • 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-15T01:02:08+00:00Added an answer on June 15, 2026 at 1:02 am

    Here’s one way that uses Javascript, this will dynamically create and append a hidden input called back to the form, then submit the form – when the back button is clicked.

    <script>
        function postBack()
        {
            var myForm = document.getElementById("formID");
            var backInput = document.createElement("input");
            backInput.type = "hidden";
            backInput.name = "back";
            backInput.value = "1";
    
            myForm.appendChild(backInput);
            myForm.submit();
        }
    </script>
    
    
    <input type="button" onclick="postBack()" name="back" value="&#8592 Back">
    

    On the server side, you can now test for:

    if(isset($_POST['back']))
    {
        // back was pressed...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two textboxes <input id='random_value' name='random_name' value='First' <input id='random_value' name='random_name' value='' I need
for email validation I have these two input fields: <input class=inputbox type=text name=data[subscriber][email] id=field_email
I'm building an Android app and I need to have two different themes for
I have two different modules that need access to a single file (One will
I have a html input element from which I need to extract the name
I have two logical groups of input fields I need to validate separately using
I have a form that had live appended input type hiddens with a name,
So here's my scenario, I need to have an inputs name and ID equal
I have a map that I need to map to a different type, and
OS: aix shell: bsh Hi, ppl I have two types of files, one type

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.