If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
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, 21: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 21:18.
Reply With Quote
  #2 (permalink)  
Old 10-04-04, 23:55
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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, 14: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, 19:46
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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, 13: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 13:03.
Reply With Quote
  #6 (permalink)  
Old 10-06-04, 20: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, 15: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, 42 views)
Reply With Quote
  #8 (permalink)  
Old 10-31-04, 19:34
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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, 19: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, 19:25
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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

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