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

    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. Advertisements

  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.
    Norman Yuan, Aug 24, 2004
    1. Advertisements

  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'?

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

    If codeinput<>"" then
    Response.Write("The code you entered was: " & codeinput)
    End If

    Thanks again for your help...
    Guest, Aug 24, 2004
  4. Guest

    Karl Guest


    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, Aug 24, 2004
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.