How can textbox in server-side shows client-side's value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jack

    How can textbox in server-side shows client-side's value

    Hello,
    I wrote this code:
    <FORM name=form2 id=1>
    <SCRIPT Language=VBScri pt>
    dim ab
    ab=10
    </SCRIPT>
    <SCRIPT Language=VBScri pt RUNAT=Server>
    Response.Write "<INPUT type=""text"" id=text2 name=text2 value=" & ab & ">"
    'I think this procedure has problem
    Response.Write "<BR>"
    Response.Write "<INPUT type=""button"" value=""Button2 "" id=button2
    onclick=""text2 .value=ab"">"
    </SCRIPT>
    </FORM>

    When open this form,text2 doesn't show ab's value.But click button2,text2
    show ab's value.
    I want when open this form text2 shows ab's value
    Can you help me

  • Ray at

    #2
    Re: How can textbox in server-side shows client-side's value

    ab is a client-side variable. The server will not know what ab is. Throw
    in an Option Explicit, and you'll see that it's just an undeclared variable.

    Ray at home

    "Jack" <significance20 0310a@yahoo.co. jp> wrote in message
    news:uZU4Sg9sDH A.2224@TK2MSFTN GP09.phx.gbl...[color=blue]
    > Hello,
    > I wrote this code:
    > <FORM name=form2 id=1>
    > <SCRIPT Language=VBScri pt>
    > dim ab
    > ab=10
    > </SCRIPT>
    > <SCRIPT Language=VBScri pt RUNAT=Server>
    > Response.Write "<INPUT type=""text"" id=text2 name=text2 value=" & ab &[/color]
    ">"[color=blue]
    > 'I think this procedure has problem
    > Response.Write "<BR>"
    > Response.Write "<INPUT type=""button"" value=""Button2 "" id=button2
    > onclick=""text2 .value=ab"">"
    > </SCRIPT>
    > </FORM>
    >
    > When open this form,text2 doesn't show ab's value.But click button2,text2
    > show ab's value.
    > I want when open this form text2 shows ab's value
    > Can you help me
    >[/color]


    Comment

    • Jack

      #3
      Re: How can textbox in server-side shows client-side's value

      Thank you

      Comment

      • Ray at

        #4
        Re: How can textbox in server-side shows client-side's value

        Jack, please do not multipost. Remember a few weeks back?

        Ray at work

        "Jack" <significance20 0310a@yahoo.co. jp> wrote in message
        news:uZU4Sg9sDH A.2224@TK2MSFTN GP09.phx.gbl...[color=blue]
        > Hello,
        > I wrote this code:
        > <FORM name=form2 id=1>
        > <SCRIPT Language=VBScri pt>
        > dim ab
        > ab=10
        > </SCRIPT>
        > <SCRIPT Language=VBScri pt RUNAT=Server>
        > Response.Write "<INPUT type=""text"" id=text2 name=text2 value=" & ab &[/color]
        ">"[color=blue]
        > 'I think this procedure has problem
        > Response.Write "<BR>"
        > Response.Write "<INPUT type=""button"" value=""Button2 "" id=button2
        > onclick=""text2 .value=ab"">"
        > </SCRIPT>
        > </FORM>
        >
        > When open this form,text2 doesn't show ab's value.But click button2,text2
        > show ab's value.
        > I want when open this form text2 shows ab's value
        > Can you help me
        >[/color]


        Comment

        • Phillip Windell

          #5
          Re: How can textbox in server-side shows client-side's value

          Ray,

          I sent you a message with a "private" question in it that is somewhat
          related to this. I just wanted to let you know in case you didn't
          check your personal email for a while.


          --

          Phillip Windell [CCNA, MVP, MCP]
          WAND-TV (ABC Affiliate)


          "Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in
          message news:O8ItAgDtDH A.3744@TK2MSFTN GP11.phx.gbl...[color=blue]
          > Jack, please do not multipost. Remember a few weeks back?
          >
          > Ray at work
          >
          > "Jack" <significance20 0310a@yahoo.co. jp> wrote in message
          > news:uZU4Sg9sDH A.2224@TK2MSFTN GP09.phx.gbl...[color=green]
          > > Hello,
          > > I wrote this code:
          > > <FORM name=form2 id=1>
          > > <SCRIPT Language=VBScri pt>
          > > dim ab
          > > ab=10
          > > </SCRIPT>
          > > <SCRIPT Language=VBScri pt RUNAT=Server>
          > > Response.Write "<INPUT type=""text"" id=text2 name=text2 value="[/color][/color]
          & ab &[color=blue]
          > ">"[color=green]
          > > 'I think this procedure has problem
          > > Response.Write "<BR>"
          > > Response.Write "<INPUT type=""button"" value=""Button2 ""[/color][/color]
          id=button2[color=blue][color=green]
          > > onclick=""text2 .value=ab"">"
          > > </SCRIPT>
          > > </FORM>
          > >
          > > When open this form,text2 doesn't show ab's value.But click[/color][/color]
          button2,text2[color=blue][color=green]
          > > show ab's value.
          > > I want when open this form text2 shows ab's value
          > > Can you help me
          > >[/color]
          >
          >[/color]


          Comment

          Working...