Connecting Tech Pros Worldwide Help | Site Map

Javascript problem in AJAX

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 19th, 2006, 10:15 AM
enjoywithneha@yahoo.com
Guest
 
Posts: n/a
Default Javascript problem in AJAX

Iam trying to build a 'dyanamic double combo' (where the second
combobox gets populated upon the selection of items in first). The
second combobox has atmost 20-25 entries. Out of these 4-5 entries are
static and the rest are to be filled from the database. Iam using plain
text instead of XML.

Can't innerHTML be used to populate a combobox? Do I need to use
options[] instead? If so, then do I need to use XML for that? Can it be
done without XML?

Here is a sample of what Iam doing:

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("idofsecondcombobox").inne rHTML=xmlHttp.responseText

}
}

Then in my asp file I use something like:

<% Response.write " <option selected value='1'>Choice1</option>"%>
<% Response.write " <option value='2'>Choice2</option>"%>
<% Response.write " <option value='3'>Choice3</option>"%>
<%for i = 0 to count-1%>
<% Response.write " <option value='"Array(i)&"'>Choice"&
Array(i)&"</option>"%>
<%Next%>

This is just a part of the code but the problem is that it isn't
working. Any suggestions plz?


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.