Text Field

Discussion in 'ASP General' started by Mangler, Nov 9, 2006.

  1. Mangler

    Mangler Guest

    I need to make a text field equal to the entered value. Example:
    First time to the page nothing will show up in the field because
    nothing was entered. I enter a value and submit the form. The
    redirect is to the same page to add new inforation but this time the
    value entered in that one text field will be there.

    I tried <%=Request.Form("box")%> as the value of the text field but to
    no success. Anyone have some input??
     
    Mangler, Nov 9, 2006
    #1
    1. Advertising

  2. you said you use a redirect?
    or do you mean form submittal?

    if form submittal
    <%
    dim x2, x3
    x3=""
    x2=0
    if request.form("Submit") = "Submit" then ' this is the submit button
    x2=1
    x3= request.form("box")
    end if
    %>
    <input name="box" value="<% if x2=1 then response.write x3 %>">


    "Mangler" <> wrote in message
    news:...
    > I need to make a text field equal to the entered value. Example:
    > First time to the page nothing will show up in the field because
    > nothing was entered. I enter a value and submit the form. The
    > redirect is to the same page to add new inforation but this time the
    > value entered in that one text field will be there.
    >
    > I tried <%=Request.Form("box")%> as the value of the text field but to
    > no success. Anyone have some input??
    >
     
    Michael Kujawa, Nov 9, 2006
    #2
    1. Advertising

  3. Mangler

    Evertjan. Guest

    Mangler wrote on 09 nov 2006 in microsoft.public.inetserver.asp.general:

    > I need to make a text field equal to the entered value. Example:
    > First time to the page nothing will show up in the field because
    > nothing was entered. I enter a value and submit the form. The
    > redirect is to the same page to add new inforation but this time the
    > value entered in that one text field will be there.
    >
    > I tried <%=Request.Form("box")%> as the value of the text field but to
    > no success. Anyone have some input??
    >


    if your html was:

    <form method='post'>
    <input name='box' value='<%=Request.Form("box")%>'>
    <input type='submit'>
    </form>

    it should work.

    However if you used a querystring, you would need this:

    <form>
    <input name='box' value='<%=Request.Querystring("box")%>'>
    <input type='submit'>
    </form>

    Tested.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Nov 9, 2006
    #3
  4. Mangler

    Mangler Guest

    It doesnt work. I must be doing something wrong here. Below is my
    form (scaled down to not take up alot of space) When the form submits,
    the form action goes back to the same page displaying what was just
    entered. From there aonther record with the same box number can be
    created.


    <form action="<%=MM_editAction%>" method="POST" name="frmrec"
    id="frmrec"
    onsubmit="MM_validateForm('recdte2','','R','box','','RisNum','boxqty','','RisNum','recqty2','','RisNum','recini2','','R');return
    document.MM_returnValue">
    <table width="100%" border="0" align="center" cellpadding="6"
    cellspacing="0" class="dot">
    <tr>
    <td width="10%"><select name="part" id="part">
    <option selected="selected">Select Part</option>
    <option value="A">A</option>
    </select></td>
    <td width="16%"><input name="recdte" type="text" id="recdte"
    value="<%=FormatDateTime(Now, 2)%>" /></td>
    <td width="8%">Box#
    <input name="box" type="text" id="box" size="4"
    value="<%Request.Form("box")/>
    </td>
    <td width="12%">Box Quantity
    <input name="boxqty" type="text" id="boxqty" size="5" /></td>
    <td width="25%">Quantity Reclaimed
    <input name="recqty" type="text" id="recqty2" /></td>
    <td width="13%"><input name="recini" type="text" id="recini2"
    value="<%=(rsI.Fields.Item("ini").Value)%>" /></td>
    <td width="16%"><input type="submit" name="Submit"
    value="Update" />
    <input name="hdnidlot" type="hidden" id="hdnidlot"
    value="<%=(rsS.Fields.Item("idlot").Value)%>" /></td>
    </tr>
    </table>
    <input type="hidden" name="MM_insert" value="frmrec">
    </form>
     
    Mangler, Nov 9, 2006
    #4
  5. "Mangler" <> wrote in message
    news:...
    > It doesnt work. I must be doing something wrong here. Below is my
    > form (scaled down to not take up alot of space) When the form submits,
    > the form action goes back to the same page displaying what was just
    > entered. From there aonther record with the same box number can be
    > created.
    >
    >
    > <form action="<%=MM_editAction%>" method="POST" name="frmrec"
    > id="frmrec"
    >

    onsubmit="MM_validateForm('recdte2','','R','box','','RisNum','boxqty','','Ri
    sNum','recqty2','','RisNum','recini2','','R');return
    > document.MM_returnValue">
    > <table width="100%" border="0" align="center" cellpadding="6"
    > cellspacing="0" class="dot">
    > <tr>
    > <td width="10%"><select name="part" id="part">
    > <option selected="selected">Select Part</option>
    > <option value="A">A</option>
    > </select></td>
    > <td width="16%"><input name="recdte" type="text" id="recdte"
    > value="<%=FormatDateTime(Now, 2)%>" /></td>
    > <td width="8%">Box#
    > <input name="box" type="text" id="box" size="4"


    > value="<%Request.Form("box")/>


    Miss '=' here me thinks

    > </td>
    > <td width="12%">Box Quantity
    > <input name="boxqty" type="text" id="boxqty" size="5" /></td>
    > <td width="25%">Quantity Reclaimed
    > <input name="recqty" type="text" id="recqty2" /></td>
    > <td width="13%"><input name="recini" type="text" id="recini2"
    > value="<%=(rsI.Fields.Item("ini").Value)%>" /></td>
    > <td width="16%"><input type="submit" name="Submit"
    > value="Update" />
    > <input name="hdnidlot" type="hidden" id="hdnidlot"
    > value="<%=(rsS.Fields.Item("idlot").Value)%>" /></td>
    > </tr>
    > </table>
    > <input type="hidden" name="MM_insert" value="frmrec">
    > </form>
    >
     
    Anthony Jones, Nov 9, 2006
    #5
  6. Mangler

    Evertjan. Guest

    Mangler wrote on 09 nov 2006 in microsoft.public.inetserver.asp.general:

    > It doesnt work. I must be doing something wrong here. Below is my
    > form


    Please always quote on usenet, this is not email.

    I wrote earlier:
    > if your html was:
    >
    > <form method='post'>
    > <input name='box' value='<%=Request.Form("box")%>'>
    > <input type='submit'>
    > </form>
    >
    > it should work.
    >
    > However if you used a querystring, you would need this:
    >
    > <form>
    > <input name='box' value='<%=Request.Querystring("box")%>'>
    > <input type='submit'>
    > </form>
    >
    > Tested.


    Did you try the above?
    Do you mean that the above "does not work"?

    If we, after response to that, want to discuss your code,
    please scale it down excluding all irrelevant code,
    like the table elements, but do not include values that are
    not specified in code.

    ... and always explain what "does not work" means,
    and what you did debugging and what the debugging results were.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Nov 10, 2006
    #6
    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. Jerry Manner
    Replies:
    5
    Views:
    571
    Jonathan N. Little
    Jun 9, 2005
  2. ehm
    Replies:
    2
    Views:
    210
  3. Roy Adams

    writing from hidden field to text field

    Roy Adams, Dec 20, 2004, in forum: Javascript
    Replies:
    1
    Views:
    208
  4. Sound
    Replies:
    2
    Views:
    466
    Randy Webb
    Sep 28, 2006
  5. jr
    Replies:
    3
    Views:
    454
Loading...

Share This Page