Dear Sir,

Can I use SQL query with in the Jave script being used in ASP page.
If i can please reffer me some samples code.

Actually I have made a form in ASP code it contain a combobox with items from the database. on the selection of any item its related record from the database should be appear in the text box in the same form.

Please suggest me in this regards for that I shall b very thankful to u.

Best Regards,

Naveed

Dear Sir,

Can I use SQL query with in the Jave script being used in ASP page.
If i can please reffer me some samples code.

Actually I have made a form in ASP code it contain a combobox with items from the database. on the selection of any item its related record from the database should be appear in the text box in the same form.

Please suggest me in this regards for that I shall b very thankful to u.

Best Regards,

Naveed

Hi Naveed,
Yes you can use java script for full feeling your purpose.
Here i am proving you a function for it. try this...

function AssignVal(CtrlOpt,CtrlTxt)
			{

			    var temp = ""
			    for(var i=0;i<CtrlOpt.options.length;i++)
			    {

			      if (CtrlOpt.options[i].selected)
			       {
					  if (temp !="") 
						{
							temp = temp + ", "
						}
					temp = temp + CtrlOpt.options[i].text
					}
			    }
			  CtrlTxt.value=temp

Call this function on selected index change event.

Best Luck.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.