Home All Groups Group Topic Archive Search About

Is the following script possible in asp technology



Author
25 Feb 2005 10:23 PM
Jack
Hi,
I have the following javascript that is written in html. It works great.
However, I need to transfer the concept to an asp application where the form
itself is an asp page. I was wondering if that is possible to do? Thanks in
advance.
Regards

PS: In the html page the following comes intuitively(using Visual Interdev).
However, in the asp page it does not. e.g after document.formname. the
checkbox name  does not show up in the asp page.
On the other hand the following comes intuitively in an html page
document.formname.checkboxname.checked

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>

<SCRIPT LANGUAGE="JavaScript"><!--
function codename() {

if(document.formname.checkboxname.checked)

{

document.formname.textname.disabled=true;
document.formname.checkboxname.disabled = true;
}

else
{
document.formname.textname.disabled=false;
document.formname.checkboxname.disabled = false;
}
}

//-->
</SCRIPT>

<form action="" method="" name="formname">

<input type="text"  size="10" name="textname">

<input type="checkbox" onclick="codename()" name="checkboxname" value="OFF">

<input type="submit" value="Add">

<input type="reset" value="Clear">

</form>


</BODY>
</HTML>

Author
25 Feb 2005 11:46 PM
Tim Williams
To turn that into an ASP page you would just save it as [pagename].asp
Viola!

Seriously though - what do you want the ASP page to do?  Are you asking
about coding your form validation script in ASP instead of client-side js?
VS is not going to get you there without some amount of reading....

Tim.


Show quote
"Jack" <J***@discussions.microsoft.com> wrote in message
news:1FED87F2-D9A2-40F8-BB75-CAF9019A3535@microsoft.com...
> Hi,
> I have the following javascript that is written in html. It works great.
> However, I need to transfer the concept to an asp application where the
form
> itself is an asp page. I was wondering if that is possible to do? Thanks
in
> advance.
> Regards
>
> PS: In the html page the following comes intuitively(using Visual
Interdev).
> However, in the asp page it does not. e.g after document.formname. the
> checkbox name  does not show up in the asp page.
> On the other hand the following comes intuitively in an html page
> document.formname.checkboxname.checked
>
> <HTML>
> <HEAD>
> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
> <TITLE></TITLE>
> </HEAD>
> <BODY>
>
> <SCRIPT LANGUAGE="JavaScript"><!--
> function codename() {
>
> if(document.formname.checkboxname.checked)
>
> {
>
> document.formname.textname.disabled=true;
> document.formname.checkboxname.disabled = true;
> }
>
> else
> {
> document.formname.textname.disabled=false;
> document.formname.checkboxname.disabled = false;
> }
> }
>
> //-->
> </SCRIPT>
>
> <form action="" method="" name="formname">
>
> <input type="text"  size="10" name="textname">
>
> <input type="checkbox" onclick="codename()" name="checkboxname"
value="OFF">
Show quote
>
> <input type="submit" value="Add">
>
> <input type="reset" value="Clear">
>
> </form>
>
>
> </BODY>
> </HTML>
>
Author
26 Feb 2005 2:52 AM
Ray Costanzo [MVP]
Hi Jack,

Something like this, maybe?

<%
Dim bChecked
bChecked = Request.Form("checkboxname") <> ""
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>



<form action="" method="post" name="formname">

<input type="text" value="<%=Server.HTMLEncode(Request.Form("textname"))%>"
size="10" name="textname"<% If bChecked Then Response.Write "
disabled=""disabled"""%>>
<input type="checkbox" onclick="this.form.submit();" name="checkboxname"
value="OFF"<% If bChecked Then Response.Write " checked=""checked""
disabled=""disabled"""%>>
<input type="submit" value="Add">
<input type="reset" value="Clear">
</form>

</BODY>
</HTML>

Ray at home

Show quote
"Jack" <J***@discussions.microsoft.com> wrote in message
news:1FED87F2-D9A2-40F8-BB75-CAF9019A3535@microsoft.com...
> Hi,
> I have the following javascript that is written in html. It works great.
> However, I need to transfer the concept to an asp application where the
> form
> itself is an asp page. I was wondering if that is possible to do? Thanks
> in
> advance.
> Regards
>
> PS: In the html page the following comes intuitively(using Visual
> Interdev).
> However, in the asp page it does not. e.g after document.formname. the
> checkbox name  does not show up in the asp page.
> On the other hand the following comes intuitively in an html page
> document.formname.checkboxname.checked
>
> <HTML>
> <HEAD>
> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
> <TITLE></TITLE>
> </HEAD>
> <BODY>
>
> <SCRIPT LANGUAGE="JavaScript"><!--
> function codename() {
>
> if(document.formname.checkboxname.checked)
>
> {
>
> document.formname.textname.disabled=true;
> document.formname.checkboxname.disabled = true;
> }
>
> else
> {
> document.formname.textname.disabled=false;
> document.formname.checkboxname.disabled = false;
> }
> }
>
> //-->
> </SCRIPT>
>
> <form action="" method="" name="formname">
>
> <input type="text"  size="10" name="textname">
>
> <input type="checkbox" onclick="codename()" name="checkboxname"
> value="OFF">
>
> <input type="submit" value="Add">
>
> <input type="reset" value="Clear">
>
> </form>
>
>
> </BODY>
> </HTML>
>

AddThis Social Bookmark Button