PC Review


Reply
Thread Tools Rate Thread

ASP Post Question

 
 
Ed Richter
Guest
Posts: n/a
 
      11th Jan 2004
Wondering if theres a way to pass a hidden field on to next page using the post command??

I have a form where one of the fields is called ID_num. I don't want to allow people to change their ID, so I display it on the form, but in a non-editable display. <% = rsObj("ID_num") %> (not in a form field)

The person can edit other fields as needed, then presses the submit button. I want to then update the database for that record WHERE ID_num = Request.Form("ID_num") Problem is becasue I never had a form field for ID_num, it won't pass that field. I tried adding that field as a hidden field, but still won't seem to pass it.

I've done this before, using a hidden field, but was using a get command (rather than post) to pass the variables to the page that updated the database. The get worked, but can't make this work.

Any ideas??
 
Reply With Quote
 
 
 
 
Ken Ford - PVII Support
Guest
Posts: n/a
 
      11th Jan 2004
You need a hidden field in your form that looks like this:

<input type="hidden" name="ID_num" value="<%= rsObj("ID_num") %>">

--
Ken Ford
PVII Support Team
http://www.projectseven.com


"Ed Richter" <(E-Mail Removed)> wrote in message news:fxfMb.72538$(E-Mail Removed)...
Wondering if theres a way to pass a hidden field on to next page using the post command??

I have a form where one of the fields is called ID_num. I don't want to allow people to change their ID, so I display it on the
form, but in a non-editable display. <% = rsObj("ID_num") %> (not in a form field)

The person can edit other fields as needed, then presses the submit button. I want to then update the database for that record
WHERE ID_num = Request.Form("ID_num") Problem is becasue I never had a form field for ID_num, it won't pass that field. I tried
adding that field as a hidden field, but still won't seem to pass it.

I've done this before, using a hidden field, but was using a get command (rather than post) to pass the variables to the page that
updated the database. The get worked, but can't make this work.

Any ideas??


 
Reply With Quote
 
Ed Richter
Guest
Posts: n/a
 
      11th Jan 2004
That makes sense. I didn't have the rsObj part in the hidden field. I
had originally just had: value="<%= ("ID_num") %>"

Still though not working. When I pass to the page that contains the update
query, get the following error:

Syntax error (missing operator) in query expression '(ID_num = , 17)'.
Somewhere it's picking up the comma?? No where in my page is it obvious
where this comma is coming from though? It'd not in the actual ID_num
field

As a test, instead I changed the ID field to a normal form field and
eliminated the hidden field totally. Then everything worked fine. As soon
as I delete the form field and add the ID back as hidden field, get his
error. Doing that kind of verifies that the actualy ID field is OK, but
someplace else it's picking up this comma?



"Ken Ford - PVII Support" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You need a hidden field in your form that looks like this:
>
> <input type="hidden" name="ID_num" value="<%= rsObj("ID_num") %>">
>
> --
> Ken Ford
> PVII Support Team
> http://www.projectseven.com
>
>
> "Ed Richter" <(E-Mail Removed)> wrote in message

news:fxfMb.72538$(E-Mail Removed)...
> Wondering if theres a way to pass a hidden field on to next page using the

post command??
>
> I have a form where one of the fields is called ID_num. I don't want to

allow people to change their ID, so I display it on the
> form, but in a non-editable display. <% = rsObj("ID_num") %> (not in a

form field)
>
> The person can edit other fields as needed, then presses the submit

button. I want to then update the database for that record
> WHERE ID_num = Request.Form("ID_num") Problem is becasue I never had a

form field for ID_num, it won't pass that field. I tried
> adding that field as a hidden field, but still won't seem to pass it.
>
> I've done this before, using a hidden field, but was using a get command

(rather than post) to pass the variables to the page that
> updated the database. The get worked, but can't make this work.
>
> Any ideas??
>
>



 
Reply With Quote
 
Thomas A. Rowe
Guest
Posts: n/a
 
      11th Jan 2004
Make sure you do not have a second field on the form of the same name.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

"Ed Richter" <(E-Mail Removed)> wrote in message
news:wTgMb.73464$(E-Mail Removed)...
> That makes sense. I didn't have the rsObj part in the hidden field. I
> had originally just had: value="<%= ("ID_num") %>"
>
> Still though not working. When I pass to the page that contains the update
> query, get the following error:
>
> Syntax error (missing operator) in query expression '(ID_num = , 17)'.
> Somewhere it's picking up the comma?? No where in my page is it obvious
> where this comma is coming from though? It'd not in the actual ID_num
> field
>
> As a test, instead I changed the ID field to a normal form field and
> eliminated the hidden field totally. Then everything worked fine. As soon
> as I delete the form field and add the ID back as hidden field, get his
> error. Doing that kind of verifies that the actualy ID field is OK, but
> someplace else it's picking up this comma?
>
>
>
> "Ken Ford - PVII Support" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > You need a hidden field in your form that looks like this:
> >
> > <input type="hidden" name="ID_num" value="<%= rsObj("ID_num") %>">
> >
> > --
> > Ken Ford
> > PVII Support Team
> > http://www.projectseven.com
> >
> >
> > "Ed Richter" <(E-Mail Removed)> wrote in message

> news:fxfMb.72538$(E-Mail Removed)...
> > Wondering if theres a way to pass a hidden field on to next page using

the
> post command??
> >
> > I have a form where one of the fields is called ID_num. I don't want to

> allow people to change their ID, so I display it on the
> > form, but in a non-editable display. <% = rsObj("ID_num") %> (not in a

> form field)
> >
> > The person can edit other fields as needed, then presses the submit

> button. I want to then update the database for that record
> > WHERE ID_num = Request.Form("ID_num") Problem is becasue I never had a

> form field for ID_num, it won't pass that field. I tried
> > adding that field as a hidden field, but still won't seem to pass it.
> >
> > I've done this before, using a hidden field, but was using a get command

> (rather than post) to pass the variables to the page that
> > updated the database. The get worked, but can't make this work.
> >
> > Any ideas??
> >
> >

>
>



 
Reply With Quote
 
Ed Richter
Guest
Posts: n/a
 
      11th Jan 2004
Yup, that was the problem. Had both the hidden field and the non-form
field. Got rid of the one and works.

Thanks!


"Thomas A. Rowe" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Make sure you do not have a second field on the form of the same name.
>
> --
>
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, Forums, WebCircle,
> MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "Ed Richter" <(E-Mail Removed)> wrote in message
> news:wTgMb.73464$(E-Mail Removed)...
> > That makes sense. I didn't have the rsObj part in the hidden field.

I
> > had originally just had: value="<%= ("ID_num") %>"
> >
> > Still though not working. When I pass to the page that contains the

update
> > query, get the following error:
> >
> > Syntax error (missing operator) in query expression '(ID_num = , 17)'.
> > Somewhere it's picking up the comma?? No where in my page is it

obvious
> > where this comma is coming from though? It'd not in the actual ID_num
> > field
> >
> > As a test, instead I changed the ID field to a normal form field and
> > eliminated the hidden field totally. Then everything worked fine. As

soon
> > as I delete the form field and add the ID back as hidden field, get his
> > error. Doing that kind of verifies that the actualy ID field is OK, but
> > someplace else it's picking up this comma?
> >
> >
> >
> > "Ken Ford - PVII Support" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > You need a hidden field in your form that looks like this:
> > >
> > > <input type="hidden" name="ID_num" value="<%= rsObj("ID_num") %>">
> > >
> > > --
> > > Ken Ford
> > > PVII Support Team
> > > http://www.projectseven.com
> > >
> > >
> > > "Ed Richter" <(E-Mail Removed)> wrote in message

> > news:fxfMb.72538$(E-Mail Removed)...
> > > Wondering if theres a way to pass a hidden field on to next page using

> the
> > post command??
> > >
> > > I have a form where one of the fields is called ID_num. I don't want

to
> > allow people to change their ID, so I display it on the
> > > form, but in a non-editable display. <% = rsObj("ID_num") %> (not in

a
> > form field)
> > >
> > > The person can edit other fields as needed, then presses the submit

> > button. I want to then update the database for that record
> > > WHERE ID_num = Request.Form("ID_num") Problem is becasue I never had

a
> > form field for ID_num, it won't pass that field. I tried
> > > adding that field as a hidden field, but still won't seem to pass it.
> > >
> > > I've done this before, using a hidden field, but was using a get

command
> > (rather than post) to pass the variables to the page that
> > > updated the database. The get worked, but can't make this work.
> > >
> > > Any ideas??
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
my question won't post lawandgrace Microsoft Excel Misc 7 11th Feb 2010 07:51 PM
POST question TR Microsoft ASP .NET 4 10th Feb 2005 01:23 PM
question about post ming Windows XP Setup 2 6th Aug 2004 06:47 PM
POST question Michael Tissington Microsoft ASP .NET 8 5th Apr 2004 05:49 AM
First post-question Scott Computer Hardware 6 3rd Oct 2003 01:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 PM.