Hi
1 dropdownlist........... 1textbox..............2dropdownlist..................2textbox.....................3rdtextbox.
following things i want to do .
1. onselection of 1st item from 1 dropdownlist .......2dropdownlist -unvisible, 1,2,3 textbox-visible.
2.onselection of 2nd item from 1 dropdownlist .......2dropdownlist -visible, 2,3 textbox-visible. 1,- unvisible..like this
i write my code. but onselection changes are not happening
kindly see code and tell me what is wrong. plz suggest.
<%@ Page Language="VB" AspCompat="true" Explicit="false" EnableEventValidation="false" Inherits="myPage" %><%--<%@ Import namespace="ADODB" %><% RStoTablePre()%>--%><script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) txtUserId.Visible = False DropDownList1.Visible = False TextBox1.Visible = False ttdesg.Visible = False If Request("op") = "open" Then BID.Value = openRecords("LETTERMASTER", " ID=" & Request("ID")) End If End Sub Protected Sub ddlist_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Select Case ddlist.SelectedItem.Text Case "Ministry of India" txtUserId.Visible = True DropDownList1.Visible = False TextBox1.Visible = True ttdesg.Visible = True Case "Department of Jharkhand" txtUserId.Visible = False DropDownList1.Visible = True TextBox1.Visible = True ttdesg.Visible = True Case "District of Jharkhand" txtUserId.Visible = False DropDownList1.Visible = True TextBox1.Visible = True ttdesg.Visible = True Case "Others" txtUserId.Visible = False DropDownList1.Visible = False TextBox1.Visible = True ttdesg.Visible = True End Select End Sub Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) On Error Resume Next DBInit() Err.Clear() 'response.write("Select department_code,department_name from departments where department_code='" & dept98 & "'") RStoCombo("select distinct vip_catagory from lettermaster where office_code in (select OFFICE_CODE from offices where DEPARTMENT_CODE='" & dept98 & "')", 0, 0, txVIP_CATAGORY, "") txsender_date.Text = Date.Today.ToShortDateString txVIP_CATAGORY.Attributes.Add("onhelp", "var new_vh=window.prompt('Enter the New Catagory Name','');if ((new_vh!='')&&(new_vh!=null)) {var vopt;vopt=this; vopt.options[vopt.length]=new Option(new_vh,new_vh,vopt.defaultSelected,true)}return(false);") RStoCombo("Select office_name, office_code from offices where department_code='" & dept98 & "' order by 1", 0, 1, txother_details, "") End Sub Protected Sub btSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) On Error Resume Next Dim exFld As String = "", exVal As String = "" diaryno = getdiarynol() Response.Write(diaryno) Select Case txFILED.SelectedItem.Text Case "Nothing" Case "Send" exFld = exFld & "disp_office_code;" exVal = exVal & BOfficeFile.Text & ";" Case "File" exFld = exFld & "file_Code;" exVal = exVal & BOfficeFile.Text & ";" End Select Err.Clear() FileId = SaveData("filetracker.LETTERMASTER", " ID=" & BID.Value, exFld & "OFFICE_CODE;DIARY_NO;USER_CODE;FILETYPE", exVal & office98 & ";" & diaryno & ";" & user98 & ";" & Right(txsoftcopy.FileName, 3)) If FileId <> 0 Then rst.Close() rst.Open("select softcopy, filetype from filetracker.lettermaster where id=" & FileId, cnn, 1, 2) Dim flen As Integer flen = txsoftcopy.FileBytes.Length If flen < 1000000 Then rst(0).Value = txsoftcopy.FileBytes rst.Update() Else rst(1).Value = "" rst.Update() End If If BID.Value = 0 Then Select Case txFILED.SelectedItem.Text Case "Send" cnn.Execute("insert into lettertrans (file_letter, letter_office_code, letter_diary_no, diary_no, office_code, receipt_date, receipt_time, receipt_flag, transit_flag, receipt_date_time, is_new, ad_file_code, ns_file_code, next_office_code, desp_date, desp_time, desp_flag, next_office_receipt_status, despatch_date_time) values('" & "L" & "', '" & office98 & "', '" & diaryno & "', '" & diaryno & "', '" & office98 & "', sysdate , sysdate , '" & "1" & "', '" & "1" & "',sysdate , '" & "1" & "', '" & "S" & "', '" & "SL" & "','" & BOfficeFile.SelectedValue & "',sysdate,sysdate, '" & "1" & "', '" & "0" & "',sysdate )") Case "Nothing" cnn.Execute("insert into lettertrans (file_letter, letter_office_code, letter_diary_no, diary_no, office_code, receipt_date, receipt_time, receipt_flag, transit_flag, receipt_date_time, is_new, ad_file_code, ns_file_code,next_office_receipt_status) values('" & "L" & "', '" & office98 & "', '" & diaryno & "', '" & diaryno & "', '" & office98 & "',sysdate,sysdate, '" & "1" & "', '" & "1" & "',sysdate, '" & "1" & "', '" & "S" & "', '" & "SL" & "' ,'0')") End Select diarynoNum = Right(diaryno, Len(CStr(diaryno)) - 1) cnn.Execute("update offices set letter_current_diary_no = " & diarynoNum & " where office_code = '" & office98 & "'") End If msgtd.Text = "Records saved successfully. ID: " & FileId & " File diary No : " & diaryno txletter_no.Text = "" txsender_date.Text = Date.Today.ToShortDateString txsender.Text = "" txsubject.Text = "" txother_details.Text = "" Else msgtd.Text = "Records could not be saved. Error: " & Err.Description End If End Sub Protected Sub txFILED_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Select Case txFILED.SelectedItem.Text Case "Nothing" BOfficeFile.Visible = False Case "Send" Dim sqll As String = "" sqll = "select 0, disp_office_code as office_code, (select office_name from offices where office_code=disp_office_code) as office_name from disp_offices where office_code='" & office98 & "' and disp_office_code in (select office_code from offices where office_level<>'STOP') order by id" RStoCombo(sqll, 2, 1, BOfficeFile, "") BOfficeFile.Visible = True Case "File" RStoCombo("select chg_filename from filemaster where filemaster.DEPARTMENT_CODE='" & dept98 & "' and filemaster.SECTION_CODE='" & section98 & "' ", 0, 0, BOfficeFile, "") BOfficeFile.Visible = True End Select End Sub Protected Sub txIS_VIP_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) If txIS_VIP.SelectedValue = 1 Then txVIP_CATAGORY.Visible = True Else txVIP_CATAGORY.Visible = False txVIP_CATAGORY.SelectedIndex = 0 End If End Sub Protected Sub txsender_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) End Sub </script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"><title>File Tracker >> Letter >> New Letter Receipts</title><link rel="Stylesheet" href="../inc/htmlstyle.css" /><script type="text/javascript" language="javascript" src="../inc/script.js"></script><link type="text/css" rel="stylesheet" href="../file/inc/wioc_rich.css" /><%--<link href="../file/inc/hi_style.css" rel="stylesheet" type="text/css" />--%><script language="javascript" src="../file/inc/main.js?ver=v11&pg=EDITOR"></script><script type="text/javascript" src="../file/inc/resource_HI.js?ver=v11"></script><script type="text/javascript" src="../file/inc/wioc_rich_action.js?ver=v11"></script><script type="text/javascript" src="../file/inc/wioc_rich.js?ver=v11"></script><script type="text/javascript"> var rich = null; window.onload = function(){ try{ loadControl('EN'); }catch(e){} // document.getElementById('showbutton').style.display='block'; // document.getElementById('wordsugg').style.display='block'; }; function _wiocRichControlSetProperties(obj){ try{ obj.setDictOn(true); }catch(err){ alert(err); } } function loadControl(lan){ if (lan=='HI') { try{ rich = new WiocRich('660px','80px','hello','txfile_subject','HI','R' ,1,''); rich.setHtml(document.forms[0]['txsubject'].value); }catch(e){} } else { try{ rich = new WiocRich('660px','80px','hello','txfile_subject','EN','R' ,1,''); rich.setHtml(document.forms[0]['txsubject'].value); }catch(e){} } } function saveControl() { document.forms[0]['txsubject'].value= rich.getHtml(); } function changeLanguage(id) { var chek = document.getElementById('chk_color'); //chek.checked=false; if (id.checked) { saveControl(); loadControl('HI'); } else { saveControl(); loadControl('EN'); } } </script></head><body topmargin="0"><form id="form1" runat="server"><div><asp:HiddenField ID="BID" runat="server" Value="0" /><table border="0" style="border-collapse: collapse" width="100%" id="table1"><tr><td><font size="5" color="#5ED548"><b>Received Letter Entry</b></font></td></tr><tr><td height="189"><table border="0" style="border-collapse: collapse" width="840" id="table2" bordercolor="#008000" height="199"><tr><td style="border-style: solid; border-width: 1px" height="152"><div align="center"><table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" height="49" id="table3"><tr><td width="25%" height="25" align="left"></td><td width="24%" height="25" align="left"></td><td height="25" align="left"></td><td width="37%" height="25" align="left"><asp:TextBox ID="txIS_IMPORTANT" runat="server" CssClass="tx" Width="0px" Enabled=false >0</asp:TextBox></td></tr><tr><td width="25%" height="24" align="left"> Letter No.</td><td width="24%" height="24" align="left"> <asp:TextBox ID="txletter_no" runat="server" CssClass="tx" Width="84px"></asp:TextBox></td><td height="24" align="left"> Date</td><td width="37%" height="24" align="left"><asp:TextBox ID="txsender_date" runat="server" CssClass="tx" Width="84px"></asp:TextBox></td></tr><tr><td width="25%" height="24" align="left"> Letter From</td><td width="75%" height="24" colspan="3" align="left"> <asp:DropDownList ID="ddlist" runat="server" OnSelectedIndexChanged="ddlist_SelectedIndexChanged"><asp:ListItem>Ministry of India</asp:ListItem><asp:ListItem>Department of Jharkhand</asp:ListItem><asp:ListItem>District of Jharkhand</asp:ListItem><asp:ListItem>Others</asp:ListItem></asp:DropDownList> <asp:TextBox ID="txtUserId" runat="server" onfocus="Focus(this.id,'User ID')" onblur="Blur(this.id,'User ID')" Width="126px" CssClass="WaterMarkedTextBox">Enter the Name</asp:TextBox> <asp:DropDownList ID="DropDownList1" runat="server"><asp:ListItem>Dept</asp:ListItem></asp:DropDownList> <asp:TextBox ID="TextBox1" runat="server" onfocus="Focus(this.id,'User ID')" onblur="Blur(this.id,'User ID')" Width="126px" CssClass="WaterMarkedTextBox">Name</asp:TextBox> <asp:TextBox ID="ttdesg" runat="server" onfocus="Focus(this.id,'User ID')" onblur="Blur(this.id,'User ID')" Width="126px" CssClass="WaterMarkedTextBox">Designation</asp:TextBox><br /></td></tr></tr><tr><td width="25%" height="24" align="left"> Letter To</td><td width="75%" height="24" colspan="3" align="left"> <asp:DropDownList ID="txother_details" runat="server" CssClass="tx" Width="396px" AutoPostBack="False"></asp:DropDownList></td></tr><tr><td width="25%" height="24" align="left"> Subject<br /> <input type="checkbox" onclick ="javascript:changeLanguage(this);" id="chk_color" name="chk_color" value=1 >Hindi<br /><p class="style1">(Max Length 100 Characters Only)</p></td><td width="75%" height="24" colspan="3" align="left"><asp:TextBox ID="txsubject" runat="server" CssClass="tx" Width="0px" style="OVERFLOW: hidden;" Height="15px" TextMode="SingleLine" MaxLength="300"></asp:TextBox><span align="center" id="hello" tabindex="1" class="getfont_2" ><div style="padding-top:60px;text-align:center;" ><img align="absmiddle" src="../file/inc/ajax-loader1.gif" /></div></span></td></tr><%--<tr><td width="19%" height="24" align="left"> Other Details</td><td width="82%" height="24" colspan="4" align="left"> <asp:TextBox ID="txother_details" runat="server" CssClass="tx" Width="396px"></asp:TextBox></td></tr>--%><tr><td width="101%" height="24" align="left" colspan="4"><table border="0" style="border-collapse: collapse" width="100%" id="table4"><tr><td style="width: 206px"> What to do</td><td style="width: 181px"> <asp:DropDownList ID="txFILED" runat="server" CssClass="tx" OnSelectedIndexChanged="txFILED_SelectedIndexChanged" AutoPostBack="True"><asp:ListItem>Nothing</asp:ListItem><asp:ListItem Value="0">Send</asp:ListItem><asp:ListItem Value="1">File</asp:ListItem></asp:DropDownList></td><td style="width: 65px" colspan="2"><asp:DropDownList ID="BOfficeFile" runat="server" CssClass="tx" Width="268px" Visible="False"></asp:DropDownList></td><td> </td><td> </td></tr></table></td></tr><tr><td align="left" width="25%" style="height: 24px"> Important?</td><td align="left" colspan="3" style="height: 24px"><table border="0" style="border-collapse: collapse" width="100%" id="table5"><tr><td style="width: 47px"><asp:DropDownList ID="txIS_VIP" runat="server" CssClass="tx" OnSelectedIndexChanged="txIS_VIP_SelectedIndexChanged" AutoPostBack="True"><asp:ListItem Value="0">No</asp:ListItem><asp:ListItem Value="1">Yes</asp:ListItem></asp:DropDownList></td><td> <asp:DropDownList ID="txVIP_CATAGORY" runat="server" CssClass="tx" Width="268px" Visible="False"></asp:DropDownList></td></tr></table></td></tr><tr><td width="25%" height="24" align="left"> Soft Copy File</td><td width="75%" height="24" colspan="3" align="left"> <asp:FileUpload ID="txsoftcopy" runat="server" Width="390px" /></td></tr></table></div></td></tr><tr><td style="border-style: solid; border-width: 1px; text-align: center;" background="../images/bg6.gif"> <asp:Button ID="btSave" runat="server" Text="Save" OnClientClick="saveControl()" OnClick="btSave_Click" /></td></tr></table></td></tr><tr><td><asp:Label ID="msgtd" runat="server" ForeColor="Red"></asp:Label></td></tr></table><p></div><table width="100%" ><tr><td style="border-style: solid; border-width: 1px; margin-left: 10; margin-right: 10" valign="top" width="100%" height="240"><div align=center><% DBInit() If Request("op1") = "del" Then cnn.Execute("delete from lettermaster where id=" & Request("id")) Response.Write("Letter deleted successfully.") End If 'op = Request.QueryString("op") category = Request.QueryString("category") cat = IIf(Request.QueryString("category") = "", "is null", "='" & Request.QueryString("category") & "'") 'B_go = Request.QueryString("B_go") 'REGSQL = "select decode(filetype,null,'. . . . . . . | <a href=""?op1=del'||'&'||'id='||ID||'"" onclick=""return window.confirm(''Are you sure to delete this Letter. This can not be reverted.'')"">Delete</a>','<a href=""../inc/getfile.aspx?id='||id||'&'||'doctype='||lettermaster.filetype||'&'||'file=filetracker.lettermaster-softcopy"" target=_blank>Download</a> | <a href=""?op1=del'||'&'||'id='||ID||'"" onclick=""return window.confirm(''Are you sure to delete this Letter. This can not be reverted.'')"">Delete</a>') as ""_"", id as ""Ref No"", '<a href=""frmlettertrack.aspx?office_code='||office_code||'&'||'diaryno='||diary_no||'"">'||letter_no||'</a>' as ""Letter No"", sender_date as SDate, sender as ""Sent To"", subject from lettermaster where is_important='1' and office_Code in (select office_code from offices where department_code='" & dept98 & "') order by id desc" ' id in (select id from ( SELECT id,office_code, is_important, RANK() OVER (ORDER BY id DESC) as sal_rank FROM lettermaster where is_important='1' and office_Code in (select office_code from offices where department_code='" & dept98 & "') WHERE sal_rank <= 3) REGSQL = "select decode(filetype,null,'. . . . . . . | <a href=""?op1=del'||'&'||'id='||ID||'"" onclick=""return window.confirm(''Are you sure to delete this Letter. This can not be reverted.'')"">Delete</a>','<a href=""../inc/getfile.aspx?id='||id||'&'||'doctype='||lettermaster.filetype||'&'||'file=filetracker.lettermaster-softcopy"" target=_blank>Download</a> | <a href=""?op1=del'||'&'||'id='||ID||'"" onclick=""return window.confirm(''Are you sure to delete this Letter. This can not be reverted.'')"">Delete</a>') as ""_"", id as ""Ref No"", '<a href=""frmlettertrack.aspx?office_code='||office_code||'&'||'diaryno='||diary_no||'"">'||letter_no||'</a>' as ""Letter No"", sender_date as SDate, sender as ""Letter From"",(select office_name from offices where office_code=other_details) as ""Letter To"", subject from lettermaster where id in (select id from ( SELECT id,office_code, is_important, RANK() OVER (ORDER BY id DESC) as sal_rank FROM lettermaster where is_important='0' and office_Code ='" & office98 & "' ) where sal_rank<=10) " 'Response.Write(REGSQL) RStoTable(REGSQL, "LETTERS " & IIf(category <> "", " (CATEGORY: " & UCase(category) & ")", "") & ";impletters;impletters", "100%;400", 5, 15, -1, "10;8;8;10;10;10", "") %></div></td></tr> </table></form></body></html>