How to Refresh asp page,when user selects a value in dropdownbox? [Answered]RSS

3 replies

Last post Jun 03, 2010 02:30 PM by tomkmvp

  • 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)"
           ID="RptType">
           <option value="overall" id="seloverall" selected>Overall</option>
           <option value="Pure" id="selpure">Pure</option>
           <option value="Impure" id="selimpure">Impure</option>
          </select>
    <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>
  • Re: How to Refresh asp page,when user selects a value in dropdownbox?

    Jun 01, 2010 05:55 PM|tomkmvp|LINK

    venkatzeus

    The college.asp page is available inside the Home page.

    What does that mean?

    venkatzeus

    how do i submit the page, when there is no form element.

    The answer to this will be determined by the answer to my question.

  • Re: How to Refresh asp page,when user selects a value in dropdownbox?

    Jun 02, 2010 12:38 AM|venkatzeus|LINK

    Hi,

    Home.asp is like this:

    [CODE]

    <form name="frmHome" method="post" action="">
    <table>
    <tr>
    <td>
    <table>
     <tr>
     <td colspan="1">
                <IFRAME align="center" id="ifrmORt" name="ifrmORt" src="" scrolling="auto" width="100%" height="375"
                 frameborder="1"></IFRAME>
               </td>
    </tr>
    </table>

    <table >
    <tr>
    <td align="right"  height="19">
    <!-- #include file="college.asp" -->
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>

    </form>

    [/CODE] 

    Thank you

  • Re: How to Refresh asp page,when user selects a value in dropdownbox?

    Jun 03, 2010 02:30 PM|tomkmvp|LINK

    You can write a client-side javascript handler that will submit the form when the dropdown changes values.  You can treat the college.asp as if it is part of home.asp.