473,698 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple submit buttons in one page - PHP and MYSQL

1 New Member
Hello

I have four submit buttons on my page - each carrying a value which refreshes the page selects from my db and displays the results in the drop down.

The prob is i would like another submit button which will run the queries and display the drop down.

(i need to have it that way because i enter into text field, then click one of four buttons, which displays radio buttons depending on the button clicked) then click on the radio button and THEN click submit, which will use all of the varibles from the text box, button selected and the radio to run a query in the db.

It currently works without the extra submit button and the radio button defaulted to an option.

The submit button refreshes the page and everything is blank

Any ideas, suggestions would be greatly appreciated - I am not a programmer - so please asume i know nothing.

Thanks in advance.

Fliss
Nov 20 '06 #1
2 4719
cassbiz
202 New Member
I would suggest going with an AJAX form so that it will auto-update with what you need.
Nov 20 '06 #2
ronverdonk
4,258 Recognized Expert Specialist
When you are not a programmer, it will be hard to explain.
When processing the POSTed values (I assume it is posted) in a different script then the one that asks for the input, you must save them somewhere, an easy place would be the $_SESSION array. Then, when the page is refreshed, you can take the values from the $_SESSION array and display the values in the value fields or the 'checked=checke d' value in the radio button entries.
That is basically what you should do to re-display after processing the POSTed values in another script.

When you process the values after a submit button in the same script as the one that submits, you simply display the results (see above) from the $_POST array into the form fields.

I cannot describe this process any simpler then this.

Ronald :cool:
Nov 20 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
9643
by: HH | last post by:
I'm learning to design web applications with php, mysql, and apache from a book. I copied a sample application called guestbook 2000 that came with the CD in the book to my htdocs folder, but couldn't get the sign guestbook page (sign.php) to work. This page first checks the value of the $submit variable. If it is not "Sign", the page displays a blank form for the guest to sign. If it is "Sign", the page process the form information and...
2
2103
by: Matt | last post by:
The ASP page has multiple buttons, and when the user clicks different buttons, it will submit the form data to different URLs. My first approach was to use BUTTON type, and triggers javascript function to submit the form data. However, it didn't work properly and I changed to use SUBMIT type. <INPUT TYPE="BUTTON" NAME="action1" VALUE="Return to Main Search Page" onClick="action1()">
3
2560
by: D. Shane Fowlkes | last post by:
Sorry for the length of this post. I have created a rather complex form which has a header/line item (parent and child records) structure. It's for an intranet. A screenshot can be seen here: http://www.drpt.virginia.gov/temp1.gif All the fields on this form have validation controls on them so they can not submit the form unless all fields are completed and some fall within a specified numeric range. When the form first is loaded,...
1
2741
by: Bill_W_Stephens | last post by:
I have a complicated page with several submit buttons. I don't want to create multiple forms because much of the input is shared and the code is getting very ugly. However I would like to determine which values will be submited. Here is a simplified example that may better illustrate my question. Or maybe there is a better approach... <SCRIPT language="JavaScript">
5
20014
by: Alex Maghen | last post by:
In ASPX 2.0 with MasterPages and all that, my entire page only has one actual <FORM>. But there are several different sections of the page that provide what are functionally separate forms with separate Submit buttons. In basic HTML, I can have multiple forms on a page and the browser knows that if any of the fields for Form A have the focus, then pressing ENTER will send a Click to the submit button for Form A. Same for Form B, etc. ...
5
2454
by: mayur_hirpara | last post by:
Hi, I have been developing web applications for a while now. However, as I was thinking through the architecture I really don't understand the "How server can identify between which buttons has made the postback request.???" for e.g. I have a webpage default.aspx. I place TWO or more server buttons on it. Create server-side event handlers for each of the buttons.
2
2648
by: rudranee | last post by:
hello, How do i declare multiple submit buttons on a form? and how do i come to know on the next page which button has been clicked? Can i do it in JSP page? Please tell me.
5
14123
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
9
4267
by: mosscliffe | last post by:
I am struggling to find a python example of the scenario - I have. I have a python script, which generates a page with a search button (actually an input field). The data from the above submissions is interrogated and the same script produces a new search option and the a page of results from the previous search request. - as done by Google's Main search page. The user then has the option of a new search or navigating to a
0
8678
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9166
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.