Hi,iright now i am facing one problem i.e...
in my asp page i have two combo on selection of first combo it is going filter data in second combo which is pick form database.my problem is that when select any item in both combo it not able to show selected item in combo...i am sending my code..any one help me...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Zafesoft-Acceptable Use Policy</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
// This function used for selection of page combo selection.
function callme() {
alert("call1");
document.form1.action="EditCMS310507.asp";
document.form1.submit();
}
// This function used for selection of sub heading combo selection.
function callme1(form) {
// document.form1.action="EditCMS310507.asp";
alert("call2");
document.form1.action="EditCMS310507.asp";
document.form1.submit();
}
//Calling when update button is clicked...
function callother() {
//alert('call other called') ;
document.form1.action="UpdateCms310507.asp" ;
document.form1.submit();
}
function trim(strText)
{
// this will get rid of leading spaces
while (strText.substring(0,1) == ' ')
strText = strText.substring(1, strText.length);
// this will get rid of trailing spaces
while (strText.substring(strText.length-1,strText.length) == ' ')
strText = strText.substring(0, strText.length-1);
return strText;
while (strText.substring(strText.length-1,strText.length) == ' ')
strText = strText.substring(0, strText.length-1);
return strText;
}
function disagree()
{
input_box=confirm("Are you sure you want to cancel the update");
if (input_box==true)
{
window.location="EditCMS.aspx";
return false;
}
else
{
return false;
}
}
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "table,save,advhr,advimage,advlink,emotions,iespel l,insertdatetime,preview,zoom,flash,searchreplace, print,contextmenu",
theme_advanced_buttons1_add_before : "save,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,sepa rator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator ",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print" ,
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|h eight|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js",
width:"460"
});
</script>
<%
''''''''''''''''''''''''Page header''''''''''''''''''''''''''''''''''
'Fill combo for pagename and with page name combo
Dim pagename ,SQL2 ,pagecombo ,getvaluetest
Set db = Server.CreateObject("ADODB.Connection")
db.Open Session("ConnectionString")
SQL2="select pageid,pagename from pagedetails"
set rs1=db.execute(SQL2)
''''''''''''''''''''''''Subheading Header....''''''''''''''''''''''''''''''''''
Dim pageheaderid ,Subheader ,SQl4
Combovalue=request("page_id")
Set db = Server.CreateObject("ADODB.Connection")
db.Open Session("ConnectionString")
SQl4="select Cmsid,subheading from CMSMst where pageid='"& Combovalue &"'"
set rs2=db.execute(SQl4)
''''''''''''''''''''''''Data fetch on selection of Combo''''''''''''''''''''''''''''''''''
Dim Combovalue ,getvalue,subheaderid,sql,subCombovalue ,sql6
session("Combovalue")=request("page_id")
Combovalue=session("Combovalue")
subCombovalue=request("AddSubHeader")
Set db = Server.CreateObject("ADODB.Connection")
db.Open Session("ConnectionString")
If (subCombovalue) <> "" Then
SQL6="select Contents from CMSMst where Cmsid='"& subCombovalue &"' "
set rs=db.execute(SQL6)
If Not rs.EOF Then
getvalue=rs("Contents")
End If
Else
set rs=db.execute("select pagecontent from pagedetails where pageid='"& Combovalue &"'")
If Not rs.EOF Then
getvalue=rs("pagecontent")
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''
%>
</head>
<body>
<form name="form1" method="post" action="UpdateCms310507.asp">
<table width="760" class="main" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table width="750" class="inner" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" class="logo"><a href="index.html"><img src="images/Logo.jpg" width="159" height="115" border="0" title="Logo"/></a></td>
<td class="logo_text"><img src="images/logo_text.jpg" width="527" height="27" align="left" /></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" class="top_nav_bg"><table width="80%" class="top_nav" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="nav_circle_02"> </td>
<td class="nav_text"><a href="index.html" class="two">Home</a></td>
<td class="nav_circle_02"> </td>
<td class="nav_text"><a href="product.html" class="two">Product</a></td>
<td class="nav_circle_02"> </td>
<td class="nav_text"><a href="solutions.html" class="two">Solutions</a></td>
<td class="nav_circle_02"> </td>
<td class="nav_text"><a href="partnership.html" class="two">Partnership</a></td>
<td class="nav_circle_02"> </td>
<td class="nav_text"><a href="about_us.html" class="two">About</a></td>
<td class="nav_circle_02"> </td>
<td class="nav_text"><a href="http://74.52.134.18:8080/zafesoft/" class="two">Login</a></td>
<td class="nav_circle_02"> </td>
<td class="nav_text"><a href="contact_us.html" class="two">Contact</a></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"><table width="750" class="maincontent_box" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="top_curve"> </td>
</tr>
<tr>
<td align="center" class="mid_bg"><table class="inner_contentbox" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table class="inner_contentbox" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="92%" border="0" align="center" cellpadding="0" cellspacing="0" class="form">
<tr>
<td colspan="2"><h2 class="header">Content Management System </h2></td>
</tr>
<tr>
<td width="13%"> </td>
<td width="87%"> </td>
</tr>
<tr>
<td align="left"> Page name:<span>*</span></td>
<td align="left"><select name="page_id" onchange="callme(this.form.page_id.value);" mandatory='true' class="text">
<option value="">--Select Page--</option>
<%
do while not rs1.eof%>
<option value="<%=rs1("pageid")%>" <%if request.Form("page_id") =rs1("pageid") then response.Write(" selected")%>><%=rs1("pagename")%></option>
<%rs1.moveNext
loop%>
</select> </td>
</tr>
<tr>
<td align="left">Add SubHeader: </td>
<td align="left">
<select name="AddSubHeader" onchange="callme1(this.form);">
<option value="">Add SubHeader</option>
<option value="">=============</option>
<%
do while not rs2.eof%>
<%session("Subcombovalue")=rs2("Cmsid")
abc=session("Subcombovalue")%>
<option value="<%=rs2("Cmsid")%>" <%if request.Form("AddSubHeader") =rs2("Cmsid") then response.Write(" selected")%>><%=rs2("subheading")%></option>
<%rs2.moveNext
loop%>
</select> </td>
</tr>
<tr>
<td>Sub Heading Title:</td>
<td><input name="SubHeadingTitle" class="instyle" type="text" id="SubHeadingTitle" value=""/></td>
</tr>
<tr>
<td>Description:<span>*</span></td>
<td> </td>
</tr>
<tr>
<td colspan="2"><textarea name="txtDescription" style="width: 406px; height: 346px"><%=getvalue %></textarea></td>
</tr>
<input type = "hidden" value ="<%=Combovalue %>" name="pageid">
<input type = "hidden" value ="<%=getvalue %>" name="cmsid">
<tr>
<td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10%"><input name="Update" type="submit" id="Update" value="Update" onclick="callother();"/></td>
<td width="90%"><input name="Cancel" type="submit" id="Cancel" value="Cancel" /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="bottom_curve"> </td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center"><table width="80%" class="footer" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="index.html" class="one">Home</a> | <a href="solutions.html" class="one">Solutions</a> | <a href="Support.html" class="one">Support</a> | <a href="request_product_information.html" class="one">Request Info</a> | <a href="careers.html" class="one">Careers</a> | Acceptable Use Policy |<a href="privacy_policy.html" class="one"> Privacy Policy</a> | <a href="terms_of_use.html" class="one">Terms Of Use</a> | <a href="#" class="one">FAQ</a> | <a href="#" class="one">News</a></td>
</tr>
<tr>
<td class="footer_copyright">2007-ZafeSoft. All rights reserved</td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>