Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Select Control's Question

Reply
Thread Tools

Select Control's Question

 
 
Jack
Guest
Posts: n/a
 
      01-16-2004
Hello,
<%@ Language=VBScript %>
<%
Response.Write "<FORM name=form1>"
dim x
Response.Write "<select name=""select1"">"
Response.Write "<option value=1>One</option>"
Response.Write "<option value=2>Two</option>"
Response.Write "<option value=3>Three</option>"
Response.Write "</select>"
Response.Write "</FORM>"
%>
I want a event,when select1 change,x=select1's value.
Thank you

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      01-16-2004
Jack wrote on 16 jan 2004 in microsoft.public.inetserver.asp.general:

> Hello,
> <%@ Language=VBScript %>
> <%
> Response.Write "<FORM name=form1>"
> dim x
> Response.Write "<select name=""select1"">"
> Response.Write "<option value=1>One</option>"
> Response.Write "<option value=2>Two</option>"
> Response.Write "<option value=3>Three</option>"
> Response.Write "</select>"
> Response.Write "</FORM>"
> %>
> I want a event,when select1 change,x=select1's value.
> Thank you


You cannot get that serverside.

Serverside is closed once your page is on the client.

You will need to submit the form to the server and use
request.form or request.querystring


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
Jack
Guest
Posts: n/a
 
      01-16-2004
Thank you,
<%@ Language=VBScript %>
<SCRIPT LANGUAGE=VBScript>
dim y
</SCRIPT>
<%
dim x
Response.Write "<FORM name=form1 METHOD=""POST"">"
Response.Write "<INPUT type=""submit"" value=""Submit"" id=submit1
name=submit1>"
Response.Write "</FORM>"
%>
I don't know how can submit y to x in form1.
Can you give me some advice?

 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      01-16-2004
x is a client-side variable. y is server-side. Neither of them has a
value. What do you want to do with them?

Ray at work

"Jack" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thank you,
> <%@ Language=VBScript %>
> <SCRIPT LANGUAGE=VBScript>
> dim y
> </SCRIPT>
> <%
> dim x
> Response.Write "<FORM name=form1 METHOD=""POST"">"
> Response.Write "<INPUT type=""submit"" value=""Submit"" id=submit1
> name=submit1>"
> Response.Write "</FORM>"
> %>
> I don't know how can submit y to x in form1.
> Can you give me some advice?
>



 
Reply With Quote
 
Jack
Guest
Posts: n/a
 
      01-17-2004
Thank you,
I want submit a client-side variable to server-side,because my application
need it.
Can anyone help me

 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      01-17-2004

<%
If Request.Form("hiddenInput") <> "" Then
Response.Write "Your client side assigned value was posted: " &
Request.Form("hiddenInput")
End If
%>
<form name="jack" method="post">
<input name="hiddenInput" type="hidden">
<input type="submit">
</form>

<script language=vbscript>
document.jack.hiddenInput.value="Here's a value"
</script>

Ray at home



"Jack" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thank you,
> I want submit a client-side variable to server-side,because my

application
> need it.
> Can anyone help me
>



 
Reply With Quote
 
Mark Schupp
Guest
Posts: n/a
 
      01-17-2004
This is more of a client-side question.

one way you could do it:

<html>
<head>
<script language="javascript">
var y="whatever you want";

function submitform()
{
document.myform.yvalue.value=y;
document.myform.submit();
}
</script>
</head>
<body>

<form method="post" name="myform" action="myscript.asp">
<input type="hidden" name="yvalue" value="">
<a href="javascript.submitform();">Submit</a>
</form>

</body>
</html>

Then in myscript.asp you can get the value with

dim x
x=request.form("yvalue")

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


"Jack" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thank you,
> I want submit a client-side variable to server-side,because my

application
> need it.
> Can anyone help me
>



 
Reply With Quote
 
Jack
Guest
Posts: n/a
 
      01-17-2004
Thank you very much,but
<%@ Language=VBScript %>
<%
Response.Write "Server:"
Response.Write "<INPUT type=""text"" id=text1 name=text1
value="&Request.Form("hiddenInput")&">"
%>
<form name="jack" method="post">
<input name="hiddenInput" type="hidden">
<INPUT type="text" id=text3 name=text3>
<input type="submit">
</form>
<script language=vbscript>
document.jack.hiddenInput.value=document.jack.text 3.value
</script>

When click submit,why text1 can't show text3's value?
I wait anyone's help.

 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      01-17-2004
You're telling it to display the value of a form element named "hiddenInput"
instead of "text3."

Ray at home

"Jack" <(E-Mail Removed)> wrote in message
news:O9%(E-Mail Removed)...
> Thank you very much,but
> <%@ Language=VBScript %>
> <%
> Response.Write "Server:"
> Response.Write "<INPUT type=""text"" id=text1 name=text1
> value="&Request.Form("hiddenInput")&">"
> %>
> <form name="jack" method="post">
> <input name="hiddenInput" type="hidden">
> <INPUT type="text" id=text3 name=text3>
> <input type="submit">
> </form>
> <script language=vbscript>
> document.jack.hiddenInput.value=document.jack.text 3.value
> </script>
>
> When click submit,why text1 can't show text3's value?
> I wait anyone's help.
>



 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      01-17-2004
Jack wrote on 17 jan 2004 in microsoft.public.inetserver.asp.general:

> Thank you very much,but
> <%@ Language=VBScript %>
> <%
> Response.Write "Server:"
> Response.Write "<INPUT type=""text"" id=text1 name=text1
> value="&Request.Form("hiddenInput")&">"
> %>
> <form name="jack" method="post">
> <input name="hiddenInput" type="hidden">
> <INPUT type="text" id=text3 name=text3>
> <input type="submit">
> </form>
> <script language=vbscript>
> document.jack.hiddenInput.value=document.jack.text 3.value
> </script>
>
> When click submit,why text1 can't show text3's value?
> I wait anyone's help.
>


this:

document.jack.hiddenInput.value=document.jack.text 3.value

is executed at page loading, so BEFORE you fill text3.

==========

try:

<%@ Language=VBScript %>

Server:
<INPUT type="text"
value="<%=Request.Form("hiddenInput")%>">

<br><br>

<form name="jack" method="post"
onsubmit=
"document.jack.hiddenInput.value=document.jack.tex t3.value"
>

<input name="hiddenInput" type="hidden">
<INPUT type="text" name=text3>
<input type="submit">
</form>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
select gridview row without using select button? =?Utf-8?B?RGFiYmxlcg==?= ASP .Net 5 02-27-2009 02:56 AM
select.select() on windows jas Python 4 10-27-2005 11:10 AM
Dumb question about using a <SELECT> menu to change the state of<SELECT> menu... Bonge Boo! Javascript 5 04-25-2005 10:49 PM
Selection from One SELECT changes selected option of another SELECT? J. Hall HTML 2 04-21-2004 05:36 PM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM



Advertisments