Text Field

M

Mangler

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

Michael Kujawa

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 %>">
 
E

Evertjan.

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

Mangler

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>
 
A

Anthony Jones

Mangler said:
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
 
E

Evertjan.

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,137
Messages
2,570,795
Members
47,342
Latest member
eixataze

Latest Threads

Top