Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional 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
 
Old August 29th, 2006, 01:06 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default form field problem

Hello
I have problem with getting value of a form field in a same page. I try to get the value of hidden filed with a CStr(request("a")).but it can't be done.
I did it as below:
1-set the value of hidden field
2-Dim MM_a
MM_a=CStr(request("a"))
if MM_a="1" then
do something
end if
but it cant get the a value that is my hidden field.I tried CSt(request.form("a")) too but it didn't work either.
i would be very happy if some one tell me the solution.
thank you
 
Old August 29th, 2006, 06:16 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Is the hidden field named "a" ?

"The one language all programmers understand is profanity."
 
Old August 29th, 2006, 06:21 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

yes,the hidden field name is "a"

 
Old August 29th, 2006, 07:23 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

When the page first loads the hidden field wont have a value, at least not that ASP can capture. When you click submit, however, that field should have a value and as long as your form handler is set as the correct page you shouldnt have a problem.

So the pseudo code is something like this:

--Page Load
if hidden field is empty
  do nothing and display page

if hidden field is not empty
  process values and do other things

If the value isnt displaying or such, you have a logic error

"The one language all programmers understand is profanity."
 
Old August 30th, 2006, 12:29 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

I checked my code and i found that it cant set the value of hidden fields to a text box.let me explain you the excat thing that i want:
1-insert 8 hidden fields for 8 textbox
2-when each textbox change
set the hidden.value="1"
3-a=hidden1.value
b=hidden2.value....
h=hidden8.value
4-MM_Changecode=a&b&c&...&h
5-the textbox value is MM_Change
it makes MM_Changecode correctly(i've tested it with msgbox) but it doesn't show it in textbox
would you please help me to fix it
thank you

 
Old August 30th, 2006, 09:05 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You have completely lost me as to what you are trying to do...

"The one language all programmers understand is profanity."
 
Old August 31st, 2006, 12:23 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

excuse me, I didn't explain it in a right way.I have 8 texboxes.i want to have a string that shows if a text box has been changed or no.each character of this string belongs to a textbox.if the value is "0" it means it didn't change and if it is "1" it means it changed.then put this string in a textbox to insert to a database.so I insert a hidden field for each textbox that will get the value "1" if text box changed(the default value of each hidden field is "0"). and at the end make the string and put it in text box.it makes the string correctly but it doesn't show it in textbox.do i have wrong logic or the way i write codes is incorrect????thank you for your help

 
Old August 31st, 2006, 09:09 AM
Registered User
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to thechasboi Send a message via MSN to thechasboi Send a message via Yahoo to thechasboi
Default

hastikeyvan

I ask a phew questions to clear up some merckyness. Are you calling a new page or file after getting this data? Now after some one has changed the data in one of the the textboxes where do you go next after the data aquisition?

Charley George
Programmer
Computer Engineer
just graduated
 
Old September 2nd, 2006, 01:17 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

I hope i can explain what i want to do.This is an update page.and because it is important for me to to know if some fields has been changed or no i used a textbox that gets the value of hidden fields.and from that string i can understand if a field was changed or no.

 
Old September 2nd, 2006, 11:47 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Ok so:

If a user changes field 1 hidden field 1 changes to some value. So on the backend you would do something like:

Dim valueA
Dim hiddenA

valueA = Request.Forms("fieldA")
hiddenA = Request.Forms("hiddenA")

If hiddenA = "something" then
   Do this
Else
   do this
end if

does this help?

"The one language all programmers understand is profanity."





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to grey out a form field? kk_sg Access 4 April 29th, 2008 10:11 AM
Updating Field in Form cthibault Access 2 January 8th, 2008 03:37 PM
/> in form field crmpicco HTML Code Clinic 3 September 30th, 2005 03:57 AM
Requery a Form Field from another Form rocknrisk Access 3 September 16th, 2005 03:51 PM
unbound field in a form zanza67 BOOK: Access 2003 VBA Programmer's Reference 0 September 3rd, 2005 01:46 PM





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