473,791 Members | 3,186 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to keep entered value until user click confirm button

250 Contributor
I have a web page which is used to enter user data. In there I have 4 buttons named as "Submit, Confirm,Edit,Ca ncel". User should enter data and click "Submit " button. Then I want to display all information he entered and when user click confirm button only it should submit to the DB. Could you please tell me what is the best way? Do I need to use java script? How can I keep the form data after user click on submit button?
Expand|Select|Wrap|Line Numbers
  1. <form name="Adduser.php" id="Adduser.php" action="<? echo $PHP_SELF?>">
  2.  
  3. <input name="Confirm" value="Confirm" id="Confirm" src="../images/Confirm.jpg" type="image"  alt="add" height="30"  width="73"  style="visibility:hidden"/>
  4.                     <input name="Edit" value="Edit" id="Edit" src="../images/Edit.jpg" type="image"  alt="add" height="30"  width="73" style="visibility:hidden" />
  5.                     <input name="Submit"  id="Submit" src="../images/Submit.jpg" type="image"  alt="add" height="30"  width="73" value="commit" />
  6.  
  7.                     <input 
  8.                     id="Cancel" src="../images/Cancel.jpg" type="image"  alt="cancel" height="30"  width="73" />
  9. </form>
  10.  
Jul 13 '09 #1
3 4239
Dormilich
8,658 Recognized Expert Moderator Expert
one way to do it would be posting all values back to the input fields so that you can submit the values again (without further doing), doing an extra "preview" and at the same time inserting the confirm button.

Expand|Select|Wrap|Line Numbers
  1. // generic code
  2. <input name="test" value="$_POST['test']" ... >
  3. ...
  4. if (isset($_POST['submit'])) 
  5. {
  6.     // echo posted vars in a neat way
  7.     echo <input name="confirm" ... >
  8. }
Notes:
- your <form> ID is invalid
- $_SERVER['PHP_SELF']
Jul 13 '09 #2
ghjk
250 Contributor
I'm sorry. I can't get it.
Jul 13 '09 #3
Dormilich
8,658 Recognized Expert Moderator Expert
ok then

step 1
(HTML) write your form as usual (this you should have already done)

step 2
(PHP) write some code to display the submitted values for the user to confirm (no DB action)
this is to be triggered if the submit button is pressed

step 3
take the code of step 1 and insert the posted values as default values*
Expand|Select|Wrap|Line Numbers
  1. <input type="text" name="test"> // step 1
  2. <input type="text" name="test" value="<?php echo postback('test'); ?>">
  3. // value is the input's default value
  4. // postback($index) has to return $_POST[$index] if the submit button was pressed
step 4
insert the confirm button if the submit button is pressed

step 5
(PHP) do the DB action if the confirm button is pressed


* there are endless possibilities to do so only limited by your imagination and capabilities
Jul 13 '09 #4

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

Similar topics

4
1886
by: johnny | last post by:
hi all, I am getting lost in showing data entered in a form to a confirm page. I have a form with as many list/menu as the categories existing in the database. DONE when user choose the items from the list/menus they are passed on to a second page where he can check if all data are correct and then send it. DONE
16
11501
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not an object... the function is like so: function calc_total() { var x,i,base,margin,total,newmargin,newtotal; base = document.frmKitAmount.txtTotalKitValue.value; margin = document.frmKitAmount.margin.value/100;
5
3431
by: John Bowman | last post by:
Hi, I need some dialog handling help, I must be missing something obvious here but I can't figure out the solution to the following problem... Simple Win Forms app that has button on the form. The click event handler for the button creates another dialog (as a form object) and calls it's ShowDialog method to dsiplay it modally. The secondary dialog then appears that has OK and Cancel buttons and the user can interact as expected. Now...
4
2693
by: BBFrost | last post by:
We have a data entry application written within Framework 1.0 that contains 20+ custom user controls. The controls overlay each other so that only one custom control is visible at a time. What is the best way to keep the cursor from jumping to another non-visible control when the user tabs past the (currently designated) last control on the form. I've had some luck using the Leave event but the last visible control can change...
4
4294
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage I know I need to call a function that will save data but I'm not sure exactly when to call this function. I've tried two ways and both seem to have 'gotcha's':
1
356
by: DotNetJunkies User | last post by:
I want to include javascript confirm inside the Button_Click even procedure and contine the process based on the user selection. The real problem is how to assign javascript confirm return value to the private variable declared inside Button_Click event. Please any one help me. --- Posted using Wimdows.net NntpNews Component - Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and...
7
2716
by: BobRoyAce | last post by:
Let's say I have a text box on a page in which a user is to enter a monetary amount and that I want to ensure that the user enters a value greater than or equal to a certain value that will be determined by interrogating a database at runtime. There is a button on the page that the user clicks on to Save the data they have entered. In the click event of this button I want to check to see if they have entered a value no greater than the...
6
2550
by: Nad | last post by:
Hello, In order to go back to the previous page from a page with possible postbacks I keep Request.Referrer in ViewState and then use it to redirect to the previous page. However I am losing all the information entered in the previous page. I also want to keep the entries in many fields/controls in the previous page. Is there a way to keep the information in the previous page intact when you get back to it?
482
28028
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. what i am trying to display previously entered multiple fields. I am able to get my serial fields to display correctly, but i can not display my parts fields correctly. Currently this is what it does serial information 1 parts 1
0
9669
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
9517
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
10428
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
10156
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,...
0
9997
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5435
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...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
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.