Is this a valid tag? I want to put the value of a querystring in my text box.
<td> <input id="txtcap" style="FONT-SIZE: xx-small" maxLength="5" size="13" name="txtcap" value=<%=Request.QueryString("txtcap")%>></td>
Printable View
Is this a valid tag? I want to put the value of a querystring in my text box.
<td> <input id="txtcap" style="FONT-SIZE: xx-small" maxLength="5" size="13" name="txtcap" value=<%=Request.QueryString("txtcap")%>></td>
Yes its valid.Quote:
Originally posted by realgoldn
Is this a valid tag? I want to put the value of a querystring in my text box.
<td> <input id="txtcap" style="FONT-SIZE: xx-small" maxLength="5" size="13" name="txtcap" value=<%=Request.QueryString("txtcap")%>></td>
For better result wrap it up with quote or you will have problem if you have input shuch as single quote or double quote.
Code:<td> <input id="txtcap" style="FONT-SIZE: xx-small" maxLength="5" size="13" name="txtcap" value="<%=Request.QueryString("txtcap")%>"></td> [/B][/QUOTE]
My text box is blank but I know there is a value for the Request.QueryString("txtcap"). I tested it by saying
<%
l=Request.QueryString("txtcap").
%>
And there is a value in L but when I but it has the value in my text box its blank.
Is there another way I should be doing this?
:wave:
How are you passing the value, using Get or Post Method?Quote:
Originally posted by realgoldn
My text box is blank but I know there is a value for the Request.QueryString("txtcap"). I tested it by saying
<%
l=Request.QueryString("txtcap").
%>
And there is a value in L but when I but it has the value in my text box its blank.
Is there another way I should be doing this?
:wave:
get
Is the Value for txtcap showing up in the address box?Quote:
Originally posted by realgoldn
get
Hmm, No it isn't. Maybe I am doing something wrong. I have a form with text boxes on it. If a user wants to add a new category on the form they click the category link which brings up a popup box. The user fills ouf the popbox then clicks submit the submit button submits the form then closes the popup box. So when the popup box closes I want the value they added on the popup form to be displayed on the main form. Hope this makes sense.
Are you sure you have put the text box inside the form? Could be you are doing something wrong.
Let me deal with one question at a time. Post your html code for the textbox and how you reading the value.
Thanks. I have attached the popupform and the main form.
:mad: Why rtf? Thats too much code, i am too lazy to go through them, can you tell me where the problem is and i will try to solve it.Quote:
Originally posted by realgoldn
Thanks. I have attached the popupform and the main form.
Also i cant test it coz of all the DB stuff.
Sorry. I hope this is enought to help me out.
The popup form is like this
<FORM NAME="AddCAP" ACTION="addproj.asp" METHOD=get>
</TD> Cap #<INPUT id=txtcap
style="LEFT: 124px; WIDTH: 145px; TOP: 16px; HEIGHT: 21px" size=18
name=txtCAP readonly></P>
<P><INPUT onclick=VBScript:ValidateAddForm type=button value="Add Project" name=AddButton></P>
<form>
ValidateAddform()
if add.txtcap.value="" then
msgbox "Please select a valid division and type.",,"Input Error"
else
MsgBox "Cap number " & add.txtcap.value & " has been added!",,"Add Alert"
Add.Submit
self.close
END IF
The main form is like this
<td> <A HREF="javascript:popUp('addcap.asp')">*CAP #</FONT></td>
<FORM NAME="Addproj" ACTION="addproj.asp" METHOD=post>
<td> <input id="txtcap" style="FONT-SIZE: xx-small" maxLength="5" size="13" name="txtcap" value="<%=Request.querystring("txtcap")%>"></></td>
</form>
The main form is like this
<td> <A HREF="javascriptopUp('addcap.asp')">*CAP #</FONT></td>
<FORM NAME="Addproj" ACTION="addproj.asp" METHOD=post>
<td> <input id="txtcap" style="FONT-SIZE: xx-small" maxLength="5" size="13" name="txtcap" value="<%=Request.querystring("txtcap")%>"></></td>
</form>
When you are using a href to open the popup then the form is not getting submited.
try something like this
<td> <A HREF="javascriptopUp('addcap.asp')">*CAP #</FONT></td>
in your javascriptopUp function
create the dynamic url and then open the file
eg.
url="addcap.asp?txtcap=" + documtnt.Addproj.txtCap.value ;
that will submit the value to the addcap.asp file now.
Hope this helps.
This in an example i just put together. Modify it for your need.Quote:
Originally posted by realgoldn
The user fills ouf the popbox then clicks submit the submit button submits the form then closes the popup box. So when the popup box closes I want the value they added on the popup form to be displayed on the main form. Hope this makes sense.
r1.asp
r2.aspCode:<head>
<script>
function Insert()
{
var winW=475;
var winH=345;
var w=screen.width;
var h=screen.height;
var t=h/2-winH/2;
var l=w/2-winW/2;
var url = "r2.asp"
var hWnd = window.open(url,"","top=" + t + ", left=" + l + ", width=" + winW+ ",height=" + winH+ ",resizable=yes,status=yes,scrollbars=yes");
if ((document.window != null) && (!hWnd.opener))
hWnd.opener = document.window;
}
</script>
</head>
<body>
<form name=form1>
<input type=text name=text1 readonly>
<input type=button name=btn1 value="Select Name" onclick="javascript:Insert()">
</form>
</body>
Code:<html>
<head>
<script>
function Insert()
{
//alert(document.form1.txt1.value);
window.opener.document.form1.text1.value=document.form1.txt1.value;
window.close();
}
</script>
</head>
<body>
<form name="form1">
<input type=text name="txt1"><br>
<input type=button value="Click here to Insert" onclick="javascript:Insert()">
</form>
</body>
</html>
Thanks. I give this a try!:p