Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 30th, 2004, 02:04 AM
Authorized User
 
Join Date: Dec 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default document.form1

hi guys! i am fed up with document.form1

i have a radio field as

<form name="form1" method="post">
     <input type="radio" name="check" value="0" onClick="validate(0)">Experienced
     <input type="radio" name="check" value="1" onClick="validate(1)>Fresher
     <input type="radio" name="check" value="2" onClick="validate(2)>FinalYear

        <input type="text" name="txt" value="">
</form>

     it is going to the function validate perfectly but the problem is

function validate(varr)
    if varr=0 then
        document.form1.txt.disabled=true ...>"error" object does'nt support this method or property.error mentioned for document.form1
    end if
end function

can any human help me ..... plzz as my mind could'nt think more on this..


MuthuKumar.AL
__________________
MuthuKumar.AL
 
Old December 30th, 2004, 08:37 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi,
     you can call as follows.


<%@ Language=VBScript %>
<HTML>
<HEAD>
<script>
function validate()
{
    if(document.form1.check[0].checked)
    {
        document.form1.txt.disabled=true
    }
    else
    {
        document.form1.txt.disabled=false
    }
}
</script>
</Head>
 <Body>
 <form name="form1" method="post">
     <input type="radio" name="check" value="0" onClick="validate()">Experienced
      <input type="radio" name="check" value="1" onClick="validate()">Fresher
      <input type="radio" name="check" value="2" onClick="validate()">FinalYear
      <input type="text" name="txt" value="">
</form>
<Body>

 
Old January 3rd, 2005, 07:43 AM
Authorized User
 
Join Date: Dec 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi Suresh! superb and Really a Thanx to you...
your code works for me ... my problem solved..

but a doubt that is in VB the if syntax
if condition then statements
end if
to my knowledge but your code neither contains then it is replaced by { . this too VB syntax.
I was trying with if then but it is trigerring me errors but when i changed with yours i got it.

i need explanations abt this plz..
bye for now.
thanx

MuthuKumar.AL
 
Old January 3rd, 2005, 09:05 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi,
    In Vb script you need "Then" for If statement. But in java script you should not use "Then", Instead you have to use "{" and "}".
Currently you are writing client side validations in javascript. So you have to go the way as i mentioned. If you have any queries mail me back
Thanks
Suresh


 
Old January 4th, 2005, 05:02 AM
Authorized User
 
Join Date: Dec 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi suresh i got it . but one more help if possible to you. if you know the code in VBscript plz post it here so that let me know that. As i am getting the error mentioned above "document.form1 " sp plz guide me in vbscript if you know plz.
thanx and bye for now.

MuthuKumar.AL
 
Old January 4th, 2005, 10:00 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Try this .. (I haven't tested it)

if document.form1.check[0].checked Then
        document.form1.txt.disabled=true
else
       document.form1.txt.disabled=false
End if

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
using Form1 of Workbook1 in Workbook2 munzer1 Excel VBA 0 July 20th, 2007 12:53 PM
How to predefine location of scrollbar in Form1.We method Beginning VB 6 1 October 17th, 2006 06:13 PM
How can I print the Form1 banner on my report page furjaw Visual Basic 2005 Basics 0 April 25th, 2006 11:59 PM
Problem Opening Form1.xml alfyk20vtec Infopath 1 December 19th, 2005 05:24 AM
can not find form1 specified error sadiku ASP.NET 2.0 Basics 1 October 8th, 2004 05:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.