0

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

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by sbv
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.