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

  • Home
  • SEARCH
  • 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 849223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:04:22+00:00 2026-05-15T07:04:22+00:00

I am wanting to submit a form to different places based on selections made

  • 0

I am wanting to submit a form to different places based on selections made in the form. I had originally been planning to to send all to a central file/location and have it determine where to go next. However, I would like to do without this extra step if I could.

If the user wants to create/edit/delete elements go to page 1.
If the user wants to group/attach elements go to page 3.

I am trying to write a form builder. You can create/edit/delete forms, questions, and answers. I have everything for creating, editing, and deleting done. Those functions are performed without leaving the page, but now I am looking to assign answers to specific questions. The questions page and the answers page are separate. I am wanting to select a group of answers and submit an array of answer Ids (selected check boxes) to the question page where those Ids will then be assigned to a question. So basically the create, edit, and delete functions are on without leaving the page, but the assign function would be performed on a different page.

if(empty($delRowID) || empty(updateRowID) || empty($groupRows)) {
    qInsert();
}else{
    if(!empty($delRowID)) qDelete($delRowID);
    if(!empty(updateRowID)) qUpdate($updateRowID);
    if(!empty($groupRows)) {
        submit $groupRows to Question.php;
    }
}
  • 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-15T07:04:22+00:00Added an answer on May 15, 2026 at 7:04 am

    It is possible using JavaScript, but it’s not recommended because some people turn JS off by default because of trojans and noisy behavior of some sites. It is considered polite to have your site working both with JS enabled and disabled.

    Actually you don’t need many form actions because every operation can be done using branching in the single form handler script.
    Here is the very simple CRUD application example, performing displaying, editing, adding – all in one body and utilizing templates:

    index.php

    <?  
    mysql_connect(); 
    mysql_select_db("new"); 
    $table = "test"; 
    if($_SERVER['REQUEST_METHOD']=='POST') { //form handler part: 
      $name = mysql_real_escape_string($_POST['name']); 
      if ($id = intval($_POST['id'])) { 
        $query="UPDATE $table SET name='$name' WHERE id=$id"; 
      } else { 
        $query="INSERT INTO $table SET name='$name'"; 
      } 
      mysql_query($query) or trigger_error(mysql_error()." in ".$query); 
      header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);  
      exit;  
    }  
    if (!isset($_GET['id'])) { //listing part: 
      $LIST=array(); 
      $query="SELECT * FROM $table";  
      $res=mysql_query($query); 
      while($row=mysql_fetch_assoc($res)) $LIST[]=$row; 
      include 'list.php'; 
    } else { // form displaying part: 
      if ($id=intval($_GET['id'])) { 
        $query="SELECT * FROM $table WHERE id=$id";  
        $res=mysql_query($query); 
        $row=mysql_fetch_assoc($res); 
        foreach ($row as $k => $v) $row[$k]=htmlspecialchars($v); 
      } else { 
        $row['name']=''; 
        $row['id']=0; 
      } 
      include 'form.php'; 
    }  
    ?>
    

    form.php

    <form method="POST">
    <input type="text" name="name" value="<?=$row['name']?>"><br>
    <input type="hidden" name="id" value="<?=$row['id']?>">
    <input type="submit"><br>
    <a href="?">Return to the list</a>
    </form>
    

    list.php

    <a href="?id=0">Add item</a>
    <? foreach ($LIST as $row): ?>
    <li><a href="?id=<?=$row['id']?>"><?=$row['name']?></a>
    <? endforeach ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wanting to access a website from a different port than 80 or
I've been wanting to program for the Plan 9 operating system for a while.
I am wanting to find the distance between two different points. This I know
Wanting to implement authentication by client certificates I am experiencing some issues. First some
I wanting to show prices for my products in my online store. I'm currently
Not wanting to re-invent the wheel or anything, I was wondering if there's a
I'm wanting to parse a string into a nullable int in C#. ie. I
I'm wanting extra security for a particular point in my web app. So I
I'm wanting to get the full value of a char[] variable in the VC6
I'm wanting to execute a program and as it runs read in it's output

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.