|
Prev: Novice question on 'DetailsForm' and 'Grid'
Next: Automatic form field update based on previous form value selection
From: Brett_A on 18 Apr 2008 22:37 On Apr 18, 4:28 pm, "Evertjan." <exjxw.hannivo...(a)interxnl.net> wrote: > Brett_A wrote on 18 apr 2008 in microsoft.public.inetserver.asp.general: > > > > > On Apr 18, 12:59 pm, "Evertjan." <exjxw.hannivo...(a)interxnl.net> > > wrote: > >> Brett_A wrote on 18 apr 2008 in > >> microsoft.public.inetserver.asp.general: > > >> > I have a form where the first field is a dynamic drop-down that > >> > pulls from a db (Access). The fields associated with the query are > >> > task_id, task_name and task_rate. The field has the value of > >> > "task_id" and the label of "task_name". > > >> > In the second form field, I would like the default value to be > >> > determined by the selection made in the first field. Based on the > >> > selection of the first form field, I would like the default value > >> > of the this field (task_rate) to be populated with the associated > >> > task_rate value of the selection chosen above. > > >> > Any suggestions? > > >> If this is a serverside code problem, show your code, > >> if it is clientside code or a html Q, ask elsewhere. > > [please do not quote signatures on usenet] > > > Are for frik'n real Evertjan? > > Getting angry usually shows getting angry at yourself. > Don't, it does not help you. > > > This is an ASP forum, I'm asking an ASP question. > > How can we be sure, Bret? > Many a time Qs are asked in the wrong NG. > Your Q does not specify it as such. > > > I don't have the code because I need some direction on how to write > > the code. > > So? > > > Did you read my question? > > Yes > > > Do you understand my question? > > Not completely, it seems not directed at a serverside problem. > Could you specify the serverside Q? > It seeme you want dynamically changing formfields content. > > > Did I say I already have code that isn't working? > > Should you? > > Yes you should. > This NG usually helps people that get stuck, > but usually does not write code for others out of the blue. > > > I explain what I want and ask for suggestions. If my question isn't > > clear, than I need to fix it. > > Help yourself. > > you wrote: > >> > In the second form field, I would like the default value to be > >> > determined by the selection made in the first field. Based on the > >> > selection of the first form field, I would like the default value > >> > of the this field (task_rate) to be populated with the associated > >> > task_rate value of the selection chosen above. > > Seems very clientside to me! > Classic ASP does not know of forms > nor of dynamically changing formfields. > > -- > Evertjan. > The Netherlands. > (Please change the x'es to dots in my emailaddress) This is what you answered: If this is a serverside code problem, show your code, if it is clientside code or a html Q, ask elsewhere. If you read my question, why would you ask if I had a code problem? I hadn't gotten that fair in the development. After reading the other answers and doing more research, it is partially client-side issue - I think I need some AJAX to create the desired functionality. I was asking the initial question to see where I should start - the last sentence was "Any suggestions"? If you thought it was a client side issue, why not answer like Bob did? It was informative without being condescending. Brett
From: Brett_A on 18 Apr 2008 22:51 On Apr 18, 3:26 pm, "Bob Barrows [MVP]" <reb01...(a)NOyahoo.SPAMcom> wrote: > Brett_A wrote: > > I have a form where the first field is a dynamic drop-down that pulls > > from a db (Access). The fields associated with the query are task_id, > > task_name and task_rate. The field has the value of "task_id" and the > > label of "task_name". > > > In the second form field, I would like the default value to be > > determined by the selection made in the first field. Based on the > > selection of the first form field, I would like the default value of > > the this field (task_rate) to be populated with the associated > > task_rate value of the selection chosen above. > > This is typically done in client-side code so it is more appropriately > asked in a client-side scripting group such as > microsoft.public.scripting.jscript > However, you can look here to get a head start and narrow your question > down to more specific issues:http://classicasp.aspfaq.com/forms/how-do-i-make-one-dropdown-depend-... > > While the client-side scripting is the major part of the solution, there > may be server-side asp issues as well that we will be happy to address > here. > > -- > Microsoft MVP -- ASP/ASP.NET > Please reply to the newsgroup. The email account listed in my From > header is my spam trap, so I don't check it very often. You will get a > quicker response by posting to the newsgroup. The first form field is a dynamically populated list. The second form field is a text box, not another list. The value to populate the second text box is a value that needs to be pulled from the database determined by the value of the selected value from the first form field. I don't want a page refresh which is what seems to happen if I set it up as outlined in the samples suggested.Something has to happen on the server side to retrieve that value before any onchange event can update the second field with the proper value doesn't it? Is this a place where I need to implement some AJAX? Thanks Brett
From: Bob Barrows [MVP] on 19 Apr 2008 07:13
Brett_A wrote: > On Apr 18, 3:26 pm, "Bob Barrows [MVP]" <reb01...(a)NOyahoo.SPAMcom> > The first form field is a dynamically populated list. The second form > field is a text box, not another list. The value to populate the > second text box is a value that needs to be pulled from the database > determined by the value of the selected value from the first form > field. I don't want a page refresh which is what seems to happen if I > set it up as outlined in the samples suggested.Something has to happen > on the server side to retrieve that value before any onchange event > can update the second field with the proper value doesn't it? Right. it sounds as if you know how to accomplish the server-side aspect of this problem. > Is this > a place where I need to implement some AJAX? > If you don't want to submit the form to get the new value, then yes, AJAX, or something like that will be required. The client-side scripting group is the place to get help with that. -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM" |