Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old June 9th, 2004, 03:07 AM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to dorothee
Default 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.

  #2 (permalink)  
Old June 9th, 2004, 01:29 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
  #3 (permalink)  
Old June 9th, 2004, 09:11 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to dorothee
Default

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?


  #4 (permalink)  
Old June 10th, 2004, 02:04 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
  #5 (permalink)  
Old June 11th, 2004, 02:51 AM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to dorothee
Default

Thanks Imar. I have recreated the pages instead of having steps in the same page and now it works....



Similar Threads
Thread Thread Starter Forum Replies Last Post
insert a duplicate row with one changed field only swdgaurav SQL Language 1 December 31st, 2007 04:54 AM
'Hidden' Command Button David Mulvey Word VBA 0 January 9th, 2007 11:21 PM
Hidden field ashoka_klt ASP.NET 1.0 and 1.1 Basics 1 September 6th, 2006 07:12 AM
Validating a hidden field mkerchenski ASP.NET 1.0 and 1.1 Basics 1 June 3rd, 2004 11:20 AM
How to assign a value to a hidden field? Edward King Javascript How-To 1 May 3rd, 2004 07:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.