Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > many textboxes on one page...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-04-04, 22:15
kasic kasic is offline
Registered User
 
Join Date: May 2004
Posts: 21
many textboxes on one page...

hi!
Iam creating shopping cart for my self and now Iam stuck with some non-logical problem.
I have page wich lists all items for each group like

Mainboard
-> Abit
-> Asus
CPU
-> Intel
-> AMD
...

next to each item I have textbox with name txtItem & recordset("id"). In this textbox I need to enter amount of how many items I want to add to my cart. Next to the txtItem I have image button 'add to cart' and I need to read that value from textbox and send it through QueryString for further actions.
When I've tried to read the value, I get a blank string.

Dim txt
txt = Request.Form("txtItem" & recordset("id"))

It looks logicaly, but doesen't work! what I'm doing wrong?
thanks

Last edited by kasic : 10-04-04 at 22:18.
Reply With Quote
  #2 (permalink)  
Old 10-05-04, 00:55
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
when you are doing your request are you inside a recordset??? if so I would have thought it would barf because you would end up re-dimensioning txt.

in other words recordset("id") = "" or null so when you try your request.form etc you are looking for something that doesn't exist.
Reply With Quote
  #3 (permalink)  
Old 10-05-04, 15:21
kasic kasic is offline
Registered User
 
Join Date: May 2004
Posts: 21
I forgot to say that this is all inside a recordset in do while loop... so when I Response.Write(recordset("id")) returns valid ID so this is OK, but still wan't work.
What's the correct way to read the value from such a textbox in do while loop?
Reply With Quote
  #4 (permalink)  
Old 10-05-04, 20:46
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
I'd do something like this.....
Code:
Dim strValues Dim arrValues Do While Not myRS.eof strValues = strValues & request.form("textbox" & myRs("ID")) &"," myRS.MoveNext Loop strValues = left(strValues, len(strValues)-1) arrValues = split(strValues,",")
so you are probably not too far wrong in what you are trying.... if you want to attach your code I'm happy to have a look over it for you.
Reply With Quote
  #5 (permalink)  
Old 10-06-04, 14:00
kasic kasic is offline
Registered User
 
Join Date: May 2004
Posts: 21
thanks
I will test it and if this is what I really want it's great
otherwise I will attach that page and take a look at the code
thanks again...

Last edited by kasic : 10-06-04 at 14:03.
Reply With Quote
  #6 (permalink)  
Old 10-06-04, 21:57
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Post your part of code related to the form to be sent.
Reply With Quote
  #7 (permalink)  
Old 10-27-04, 16:50
kasic kasic is offline
Registered User
 
Join Date: May 2004
Posts: 21
here I submited the whole page, becouse I dodn't know in wich part of page it's error... I'll hope you'll fix it... thanx

P.S. I've changed extension to .txt, becouse of attachment that not supports .asp ext. and I only have WinRAR installed on this mashine, so I thought this is much easier....
Attached Files
File Type: txt default.txt (8.2 KB, 20 views)
Reply With Quote
  #8 (permalink)  
Old 10-31-04, 20:34
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
with the page you have posted you are trying to mix and match request.querystring with request.form and it doesn't really work because you are getting a querystring from the hyperlink which is not submitting the form (so there are no form values).
Reply With Quote
  #9 (permalink)  
Old 11-01-04, 20:21
kasic kasic is offline
Registered User
 
Join Date: May 2004
Posts: 21
@ rokslide

can you tell me what to do to fix it?
Iam stuck with than and I can't go further...
Reply With Quote
  #10 (permalink)  
Old 11-01-04, 20:25
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
you have a couple of choices.... what I would do is create change the hyperlink to a javascript function call that populates a hidden field with the value you currently have in the hyperlink query string and submits the form.

that way all details will be available by request.form
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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