 |
| ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 9th, 2004, 03:07 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hidden field to be changed to button?
Hi!
I am using Dreamweaver MX and .aspx, I have a form with multiple steps which loads on the same page. This page is bound to an Access database. From one step to the other, user presses button. At the end of the page after all the steps, there is a summary of all the fields to be updated and a submit button. When I create an update record via Dreamweaver menu, Dreamweaver create a hidden field. As soon as the first 'next' button is pressed by the user, it gives me an error because the form is not complete and the updated record can not be transmitted.
What I would like to do is have a condition on the hidden field that says that it can't run before last step in the form. or replace the hidden field with a button.
Please help.
|
|

June 9th, 2004, 01:29 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You could create another hidden field that you control yourself.
Make sure it has no value in the first n-1 pages. On the last page, set its value to TRUE or to whatever value makes sense.
Then, right above the code that DW has inserted for the database update, add code like this:
If Request.Form("txtMyHiddenField") = "TRUE" Then
' update code goes here
End If
This way, the code will only be executed when you're on the last page.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

June 9th, 2004, 09:11 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for your feedback.
Unfortunately, there is only 1 page with multiple forms that's reloaded everytime the user presses the next button.
So the 'Update Record' hidden field is present from the start. How do i tamper with the Update record script to only run when at the end of the forms?
|
|

June 10th, 2004, 02:04 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yes, I know. If they were separate pages, you wouldn't have the problem in the first place ;) Instead of the term Page I should have used Step, I guess.
What determines your "last step"? How does the application know you're on the last step? You should use that information to stop the Update behavior from running.....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

June 11th, 2004, 02:51 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Imar. I have recreated the pages instead of having steps in the same page and now it works....
|
|
 |