View Complete Thread
  • How to Refresh asp page,when user selects a value in dropdownbox?

    Jun 01, 2010 10:04 AM|venkatzeus|LINK

    <div id=post_message_258637>Hi,
    I have 2 asp pages - "Home" and "College". The college.asp page is available inside the Home page. So the Home page, has the form element, and the college.asp does not have form element.

    I have a dropdown in the college.asp page. There are 3 options in the dropdown, i want to refresh the page, when the user selects the data.
    As the college.asp page does not have form element, how to submit the page?
    I have tried this, In the college.asp, I have the following:

    <div style="MARGIN: 5px 20px 20px"> <div class=smallfont style="MARGIN-BOTTOM: 2px">Code:</div>
    <select style="width: 140px" name="RptType"  onchange="javascript:changeType(this.options[this.options.selectedIndex].value)"
           <option value="overall" id="seloverall" selected>Overall</option>
           <option value="Pure" id="selpure">Pure</option>
           <option value="Impure" id="selimpure">Impure</option>
    <input id=hdnType Type="Hidden" value="overall" name=hdnType /> 
    function changeRptType(StrDropdown)
     document.getElementById("hdnType").value =  StrDropdown;  
    // Server side script starts
     Dim RadioValue1
     set RadioValue1 = Request.Form("hdnType")
     strSQL = "sp_getAllData '" & RadioValue1 & "'"
     Set rstAllData = Server.CreateObject("ADODB.Recordset")
     Set rstAllData = objConn.ExecuteSQL (strSQL)
    </div>I know that inorder to use Request.Form, the page has to be submitted, But how do i submit the page, when there is no form element.

    Thank you</div>