Select Control's Question

Discussion in 'ASP General' started by Jack, Jan 16, 2004.

  1. Jack

    Jack Guest

    Hello,
    <%@ Language=VBScript %>
    <%
    Response.Write "<FORM name=form1>"
    dim x
    Response.Write "<select name=""select1"">"
    Response.Write "<option value=1>One</option>"
    Response.Write "<option value=2>Two</option>"
    Response.Write "<option value=3>Three</option>"
    Response.Write "</select>"
    Response.Write "</FORM>"
    %>
    I want a event,when select1 change,x=select1's value.
    Thank you
    Jack, Jan 16, 2004
    #1
    1. Advertising

  2. Jack

    Evertjan. Guest

    Jack wrote on 16 jan 2004 in microsoft.public.inetserver.asp.general:

    > Hello,
    > <%@ Language=VBScript %>
    > <%
    > Response.Write "<FORM name=form1>"
    > dim x
    > Response.Write "<select name=""select1"">"
    > Response.Write "<option value=1>One</option>"
    > Response.Write "<option value=2>Two</option>"
    > Response.Write "<option value=3>Three</option>"
    > Response.Write "</select>"
    > Response.Write "</FORM>"
    > %>
    > I want a event,when select1 change,x=select1's value.
    > Thank you


    You cannot get that serverside.

    Serverside is closed once your page is on the client.

    You will need to submit the form to the server and use
    request.form or request.querystring


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Jan 16, 2004
    #2
    1. Advertising

  3. Jack

    Jack Guest

    Variable's Question

    Thank you,
    <%@ Language=VBScript %>
    <SCRIPT LANGUAGE=VBScript>
    dim y
    </SCRIPT>
    <%
    dim x
    Response.Write "<FORM name=form1 METHOD=""POST"">"
    Response.Write "<INPUT type=""submit"" value=""Submit"" id=submit1
    name=submit1>"
    Response.Write "</FORM>"
    %>
    I don't know how can submit y to x in form1.
    Can you give me some advice?
    Jack, Jan 16, 2004
    #3
  4. Jack

    Ray at Guest

    Re: Variable's Question

    x is a client-side variable. y is server-side. Neither of them has a
    value. What do you want to do with them?

    Ray at work

    "Jack" <> wrote in message
    news:...
    > Thank you,
    > <%@ Language=VBScript %>
    > <SCRIPT LANGUAGE=VBScript>
    > dim y
    > </SCRIPT>
    > <%
    > dim x
    > Response.Write "<FORM name=form1 METHOD=""POST"">"
    > Response.Write "<INPUT type=""submit"" value=""Submit"" id=submit1
    > name=submit1>"
    > Response.Write "</FORM>"
    > %>
    > I don't know how can submit y to x in form1.
    > Can you give me some advice?
    >
    Ray at, Jan 16, 2004
    #4
  5. Jack

    Jack Guest

    Re: Variable's Question

    Thank you,
    I want submit a client-side variable to server-side,because my application
    need it.
    Can anyone help me
    Jack, Jan 17, 2004
    #5
  6. Jack

    Ray at Guest

    Re: Variable's Question

    <%
    If Request.Form("hiddenInput") <> "" Then
    Response.Write "Your client side assigned value was posted: " &
    Request.Form("hiddenInput")
    End If
    %>
    <form name="jack" method="post">
    <input name="hiddenInput" type="hidden">
    <input type="submit">
    </form>

    <script language=vbscript>
    document.jack.hiddenInput.value="Here's a value"
    </script>

    Ray at home



    "Jack" <> wrote in message
    news:...
    > Thank you,
    > I want submit a client-side variable to server-side,because my

    application
    > need it.
    > Can anyone help me
    >
    Ray at, Jan 17, 2004
    #6
  7. Jack

    Mark Schupp Guest

    Re: Variable's Question

    This is more of a client-side question.

    one way you could do it:

    <html>
    <head>
    <script language="javascript">
    var y="whatever you want";

    function submitform()
    {
    document.myform.yvalue.value=y;
    document.myform.submit();
    }
    </script>
    </head>
    <body>

    <form method="post" name="myform" action="myscript.asp">
    <input type="hidden" name="yvalue" value="">
    <a href="javascript.submitform();">Submit</a>
    </form>

    </body>
    </html>

    Then in myscript.asp you can get the value with

    dim x
    x=request.form("yvalue")

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Jack" <> wrote in message
    news:...
    > Thank you,
    > I want submit a client-side variable to server-side,because my

    application
    > need it.
    > Can anyone help me
    >
    Mark Schupp, Jan 17, 2004
    #7
  8. Jack

    Jack Guest

    Re: Variable's Question

    Thank you very much,but
    <%@ Language=VBScript %>
    <%
    Response.Write "Server:"
    Response.Write "<INPUT type=""text"" id=text1 name=text1
    value="&Request.Form("hiddenInput")&">"
    %>
    <form name="jack" method="post">
    <input name="hiddenInput" type="hidden">
    <INPUT type="text" id=text3 name=text3>
    <input type="submit">
    </form>
    <script language=vbscript>
    document.jack.hiddenInput.value=document.jack.text3.value
    </script>

    When click submit,why text1 can't show text3's value?
    I wait anyone's help.
    Jack, Jan 17, 2004
    #8
  9. Jack

    Ray at Guest

    Re: Variable's Question

    You're telling it to display the value of a form element named "hiddenInput"
    instead of "text3."

    Ray at home

    "Jack" <> wrote in message
    news:O9%...
    > Thank you very much,but
    > <%@ Language=VBScript %>
    > <%
    > Response.Write "Server:"
    > Response.Write "<INPUT type=""text"" id=text1 name=text1
    > value="&Request.Form("hiddenInput")&">"
    > %>
    > <form name="jack" method="post">
    > <input name="hiddenInput" type="hidden">
    > <INPUT type="text" id=text3 name=text3>
    > <input type="submit">
    > </form>
    > <script language=vbscript>
    > document.jack.hiddenInput.value=document.jack.text3.value
    > </script>
    >
    > When click submit,why text1 can't show text3's value?
    > I wait anyone's help.
    >
    Ray at, Jan 17, 2004
    #9
  10. Jack

    Evertjan. Guest

    Re: Variable's Question

    Jack wrote on 17 jan 2004 in microsoft.public.inetserver.asp.general:

    > Thank you very much,but
    > <%@ Language=VBScript %>
    > <%
    > Response.Write "Server:"
    > Response.Write "<INPUT type=""text"" id=text1 name=text1
    > value="&Request.Form("hiddenInput")&">"
    > %>
    > <form name="jack" method="post">
    > <input name="hiddenInput" type="hidden">
    > <INPUT type="text" id=text3 name=text3>
    > <input type="submit">
    > </form>
    > <script language=vbscript>
    > document.jack.hiddenInput.value=document.jack.text3.value
    > </script>
    >
    > When click submit,why text1 can't show text3's value?
    > I wait anyone's help.
    >


    this:

    document.jack.hiddenInput.value=document.jack.text3.value

    is executed at page loading, so BEFORE you fill text3.

    ==========

    try:

    <%@ Language=VBScript %>

    Server:
    <INPUT type="text"
    value="<%=Request.Form("hiddenInput")%>">

    <br><br>

    <form name="jack" method="post"
    onsubmit=
    "document.jack.hiddenInput.value=document.jack.text3.value"
    >

    <input name="hiddenInput" type="hidden">
    <INPUT type="text" name=text3>
    <input type="submit">
    </form>


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Jan 17, 2004
    #10
  11. Jack

    Jack Guest

    Re: Variable's Question

    Thank you very much
    Jack, Jan 19, 2004
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFiYmxlcg==?=

    select gridview row without using select button?

    =?Utf-8?B?RGFiYmxlcg==?=, Mar 3, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    101,515
    dch31969
    Feb 27, 2009
  2. J. Hall
    Replies:
    2
    Views:
    1,057
    Jeff Thies
    Apr 21, 2004
  3. jas

    select.select() on windows

    jas, Oct 25, 2005, in forum: Python
    Replies:
    4
    Views:
    786
    Maksim Kasimov
    Oct 27, 2005
  4. palmiere
    Replies:
    1
    Views:
    396
    Erwin Moller
    Feb 9, 2004
  5. Bonge Boo!
    Replies:
    5
    Views:
    196
    Bonge Boo!
    Apr 25, 2005
Loading...

Share This Page