assigning values to form inputs

Discussion in 'ASP .Net' started by Guest, Aug 24, 2004.

  1. Guest

    Guest Guest

    T.I.A. to whomever replys...

    I'm new to ASP. I'm reading input from a flat-file (not a DB) using a
    vbscript routine to display on an ASP form so that a user can update the
    info, submitting the form back to update the file. When I tried the html
    command:

    document.myformname.myfieldname.value = myvarname

    I get an object error msg. What is the correct ASP syntax for doing this?
     
    Guest, Aug 24, 2004
    #1
    1. Advertising

  2. Guest

    Norman Yuan Guest

    Where that line of code did you put?

    It is client end script and only runs in client browser. It has nothing to
    do with ASP.NET server side code.

    <CPY> wrote in message news:...
    > T.I.A. to whomever replys...
    >
    > I'm new to ASP. I'm reading input from a flat-file (not a DB) using a
    > vbscript routine to display on an ASP form so that a user can update the
    > info, submitting the form back to update the file. When I tried the html
    > command:
    >
    > document.myformname.myfieldname.value = myvarname
    >
    > I get an object error msg. What is the correct ASP syntax for doing this?
    >
    >
     
    Norman Yuan, Aug 24, 2004
    #2
    1. Advertising

  3. Guest

    Guest Guest

    Please disregard my previous code example and let me rephrase my question as
    I'm fairly new to internet/intranet programming. By the way, this is a
    'classic ASP' question, not necessarily an ASP .NET question; if I'm in the
    wrong newsgroup, please direct me to the right one.

    In the sample-code below, what syntax would I use in VBscript on the
    server-side to PROGRAMATICALLY set the default-value of the 'codeinput'
    field to 'AA1'?

    <html><body>
    <form action="asptest3.asp" method="post" name="myform">
    <!-- default value 'AA1' -->Enter 3-letter Code: <input type="text"
    name="codeinput" value="AA1" size="3">
    <br><br>
    <center><input type="submit" value="<< Update >>"></center>
    </form>
    <%
    dim codeinput

    codeinput=Request.Form("codeinput")
    If codeinput<>"" then
    Response.Write("The code you entered was: " & codeinput)
    End If
    %>
    </body></html>

    Thanks again for your help...


    "Norman Yuan" <> wrote in message
    news:%...
    > Where that line of code did you put?
    >
    > It is client end script and only runs in client browser. It has nothing to
    > do with ASP.NET server side code.
    >
    > <CPY> wrote in message news:...
    > > T.I.A. to whomever replys...
    > >
    > > I'm new to ASP. I'm reading input from a flat-file (not a DB) using a
    > > vbscript routine to display on an ASP form so that a user can update the
    > > info, submitting the form back to update the file. When I tried the

    html
    > > command:
    > >
    > > document.myformname.myfieldname.value = myvarname
    > >
    > > I get an object error msg. What is the correct ASP syntax for doing

    this?
    > >
    > >

    >
    >
     
    Guest, Aug 24, 2004
    #3
  4. Guest

    Karl Guest

    microsoft.public.inetserver.asp.general

    The only way to do it in ASP is to output the value in the tag

    <%
    dim someValue = "defaultValue
    %>
    <input type="submit" value="<%=somevalue%>">


    Karl

    <CPY> wrote in message news:...
    > Please disregard my previous code example and let me rephrase my question

    as
    > I'm fairly new to internet/intranet programming. By the way, this is a
    > 'classic ASP' question, not necessarily an ASP .NET question; if I'm in

    the
    > wrong newsgroup, please direct me to the right one.
    >
    > In the sample-code below, what syntax would I use in VBscript on the
    > server-side to PROGRAMATICALLY set the default-value of the 'codeinput'
    > field to 'AA1'?
    >
    > <html><body>
    > <form action="asptest3.asp" method="post" name="myform">
    > <!-- default value 'AA1' -->Enter 3-letter Code: <input type="text"
    > name="codeinput" value="AA1" size="3">
    > <br><br>
    > <center><input type="submit" value="<< Update >>"></center>
    > </form>
    > <%
    > dim codeinput
    >
    > codeinput=Request.Form("codeinput")
    > If codeinput<>"" then
    > Response.Write("The code you entered was: " & codeinput)
    > End If
    > %>
    > </body></html>
    >
    > Thanks again for your help...
    >
    >
    > "Norman Yuan" <> wrote in message
    > news:%...
    > > Where that line of code did you put?
    > >
    > > It is client end script and only runs in client browser. It has nothing

    to
    > > do with ASP.NET server side code.
    > >
    > > <CPY> wrote in message news:...
    > > > T.I.A. to whomever replys...
    > > >
    > > > I'm new to ASP. I'm reading input from a flat-file (not a DB) using a
    > > > vbscript routine to display on an ASP form so that a user can update

    the
    > > > info, submitting the form back to update the file. When I tried the

    > html
    > > > command:
    > > >
    > > > document.myformname.myfieldname.value = myvarname
    > > >
    > > > I get an object error msg. What is the correct ASP syntax for doing

    > this?
    > > >
    > > >

    > >
    > >

    >
    >
     
    Karl, Aug 24, 2004
    #4
    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. HugeBob

    Generating Form Inputs

    HugeBob, Aug 4, 2006, in forum: XML
    Replies:
    4
    Views:
    387
    Johannes Koch
    Aug 7, 2006
  2. Ellie
    Replies:
    2
    Views:
    457
    Ellie
    Oct 30, 2008
  3. Realbot

    Differences in UTF-8 html form inputs

    Realbot, Jan 8, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    215
    Realbot
    Jan 10, 2005
  4. Replies:
    9
    Views:
    250
    Randy Webb
    Oct 15, 2005
  5. weston
    Replies:
    1
    Views:
    253
    Richard Cornford
    Sep 22, 2006
Loading...

Share This Page