Confused!! how to automatically populate a field

Thread Solved

Join Date: Mar 2009
Posts: 3
Reputation: akhtarr is an unknown quantity at this point 
Solved Threads: 0
akhtarr's Avatar
akhtarr akhtarr is offline Offline
Newbie Poster

Confused!! how to automatically populate a field

 
0
  #1
Mar 3rd, 2009
Okay what I've got is a form and an array with a list of courses. The array populates a drop down list, I also have on the form a cost text box. What I would like is when the user chooses a course the cost field to automatically bring the price that matches the course (without clicking on any buttons). I am trying to do this in classic ASP and cannot use Javascript.

Can someone please help me....thanks
"It is far better to live like a Tiger for a day than to live like a jackal for a hundred years"
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 26
Reputation: s1986 is an unknown quantity at this point 
Solved Threads: 1
s1986 s1986 is offline Offline
Light Poster

Re: Confused!! how to automatically populate a field

 
0
  #2
Mar 3rd, 2009
compare dropdownlist.selecteditem to the course and fiil in the text box.check the command cause am not quit sure about it but it must be similar to it.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

Re: Confused!! how to automatically populate a field

 
0
  #3
Mar 4th, 2009
Originally Posted by akhtarr View Post
Okay what I've got is a form and an array with a list of courses. The array populates a drop down list, I also have on the form a cost text box. What I would like is when the user chooses a course the cost field to automatically bring the price that matches the course (without clicking on any buttons). I am trying to do this in classic ASP and cannot use Javascript.

Can someone please help me....thanks
populate the list....
post the form back to the same page with value from the list
and get the value corresponding to the list value using sql query....
i am working on the code...
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 3
Reputation: akhtarr is an unknown quantity at this point 
Solved Threads: 0
akhtarr's Avatar
akhtarr akhtarr is offline Offline
Newbie Poster

Re: Confused!! how to automatically populate a field

 
0
  #4
Mar 4th, 2009

Originally posted by aashishn86
populate the list....
post the form back to the same page with value from the list
and get the value corresponding to the list value using sql query....
i am working on the code...


The only thing is I have not stored courses in a database they are in an array.
"It is far better to live like a Tiger for a day than to live like a jackal for a hundred years"
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 133
Reputation: vicky_rawat is an unknown quantity at this point 
Solved Threads: 17
vicky_rawat's Avatar
vicky_rawat vicky_rawat is offline Offline
Junior Poster

Re: Confused!! how to automatically populate a field

 
0
  #5
Apr 18th, 2009
That's fine that courses are in an array, but where are the cost stored.

Moreever, if you want to do something on user selection, then either you will need to post your page back to server or you will need to use AJAx.
Vivek Rawat
Keep solving complexities.
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 10
Reputation: TomBCullen is an unknown quantity at this point 
Solved Threads: 2
TomBCullen's Avatar
TomBCullen TomBCullen is offline Offline
Newbie Poster

Re: Confused!! how to automatically populate a field

 
0
  #6
May 20th, 2009
Hi akhtarr, if you have physically entered the courses to an array, then create a multi-dimenion array which means you just add the value of the course into the array as you would normally do only now you are adding another value to it.

i.e.
  1. dim arrayName()
  2. ' only necessary if drawn from database
  3. redim arrayName(course_number)
  4.  
  5. ' add the values
  6. arrayName(0) = course_name1 & "," & course_price1
  7. arrayName(1) = course_name2 & "," & course_price2

You can retrieve these values in the same fashion as you would to populate the drop down box (select statement).
Regards,

TomBCullen
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 3
Reputation: akhtarr is an unknown quantity at this point 
Solved Threads: 0
akhtarr's Avatar
akhtarr akhtarr is offline Offline
Newbie Poster

Re: Confused!! how to automatically populate a field

 
0
  #7
Jun 2nd, 2009
Hi TomBCullen
Thanks Your post was really helpful! I have created a multi dimensional array and it is working. Thank you very much!!
"It is far better to live like a Tiger for a day than to live like a jackal for a hundred years"
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 10
Reputation: TomBCullen is an unknown quantity at this point 
Solved Threads: 2
TomBCullen's Avatar
TomBCullen TomBCullen is offline Offline
Newbie Poster

Re: Confused!! how to automatically populate a field

 
0
  #8
Jun 2nd, 2009
Your welcome, I am glad to help.

If there are any more issues you need assistance with, just let me know.
Last edited by TomBCullen; Jun 2nd, 2009 at 11:23 am.
Regards,

TomBCullen
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for ASP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC