I Have 2 Drop down LixstBox. On the Page Load, I M poputaling the data from the database in the First ListBox. I m facing Problem When the item in the ListBox contains any type of Brackets like (),{},[].When i m selecting any item from the 1st ListBox, It refreshes the data and shows the first item in the listBox. Due to this problem, I m not able to populate the data in the Second ListBox.
Please suggest appropriate suggetion.
I m Including the code which I m Using for this:
**************************
<select name="ActName" class="dropdown" id="ActName" onChange="fillType()" onBlur="dispdata()">
<option value="Select Act Name" selected>Select Act Name</option>
</select>
*******************************
<select name="ChapterName" class="dropdown" id="ChapterName">
<option value="Select Chapter Name" selected>Select Chapter
Name</option>
</select>
***********************************
<script language=Javascript>
function initControls()
{
populateBrand();
populateType();
}
var i;
function populateBrand()
{
<%
var rs = Server.CreateObject("ADODB.Recordset");
var sql = "select distinct(ActName) from ActsMaster order by ActName"
rs.Open(sql,strconnection);
var n=1;
while (!rs.EOF)
{
var stateID = rs.Fields(0);
var stateDesc = rs.Fields(0);
Response.Write("document.form1.ActName[" + n + "] = new Option('" + stateDesc+ "','" + stateID + "');");
if (new String(strpcode).search(stateID) != -1)
Response.Write("document.form1.ActName[" + n + "].selected = true;");
rs.MoveNext();
n++;
}
rs.Close();
%>
}

function populateType()
{
<%
if (strpcode != "")
{
var rs2 = Server.CreateObject("ADODB.Recordset");
var sql = "select * from ChapterMaster where ActName='" + strpcode + "' order by ChapterName"
rs2.Open(sql,strconnection);
var n=1;
while (!rs2.EOF)
{
var qqstateID = rs2.Fields("ChapterName");
var qqstateDesc = rs2.Fields("ChapterName");
Response.Write("document.form1.ChapterName[" + n + "] = new Option('" + qqstateDesc+ "','" + qqstateID + "');");
rs2.MoveNext();
n++;
}
rs2.Close();
}
%>
}
function fillType()
{
document.form1.action = "createSections0.asp?stateChanged=true";
document.form1.submit();
}
function saveData()
{
document.form1.action = "./Browse_Product.asp";
return true;
}

</script>