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 28th, 2004, 03:39 AM
Authorized User
 
Join Date: Dec 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default depending on radio button value Drop down menu

Hi Guys..

      i Have A form in which depending on the radio button value the drop down menu value should be decided..


i have a field called
 Fresher/Experienced/FinalYear -----> This One Is A radio Button..

if the Value In the Above Field Is Experienced Then The Field
   Year Of Experience ----->Drop Down field
 Should Be Enabled.

if Fresher or finalyear then the drop down should be disabled...

how to do this..
Code Plz Or A Method To Solve...

    I used onClick,onChange for Radio Button But in Vain...
This Should Not Be Done After Submitting The Form But
Should Be Done befor submitting..that is as soon as you click the radio button the drop down menu should be disabled or enabled accordingly..


plzzz Help Guys There..
Bye For Now...
       -Pray God For TSunami "Nature Calamity"
                 -Only God Can render Peace to TSunami Affectors"


MuthuKumar.AL
__________________
MuthuKumar.AL
 
Old December 28th, 2004, 04:23 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

You can use onclick event to do the same. Here is the sample code:

<SCRIPT LANGUAGE=javascript>
<!--
function test(what)
{
    if(what == 0)
    {
    if (document.form1.r1[what].checked)
         document.form1.t1.disabled=true;
    }
    else
    {
    if (document.form1.r1[what].checked)
         document.form1.t1.disabled=false;
    }
}
//-->
</SCRIPT>

<P>&nbsp;</P>
<form name =form1 method=post>
<input type=radio name=r1 value=0 onclick="test(0);">A
<input type=radio name=r1 value=1 onclick="test(1);">B
<input type=radio name=r1 value=2 onclick="test(2);">C

<input type=text name=t1>

Hope This Helps...


Om Prakash
 
Old December 28th, 2004, 06:24 AM
Authorized User
 
Join Date: Dec 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx OmPrakash! Your Code Perfectly Works !!

       Let Me Try With My Modifications..

If Any Doubts I will Post Further ...

Thanx
 -Bye For Now

MuthuKumar.AL
 
Old December 28th, 2004, 08:37 AM
Authorized User
 
Join Date: Dec 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi OmPrakesh!


   the code is not working in VBScript
i modified accordingly ..
her e is the code

<HTML>
<HEAD>
  <TITLE>Dynamic Drop Down Menu</TITLE>
<Script type="text/vbscript">
   sub check_onClick
      document.write "entered"
      if document.form1.check.value = 0 then
        exit sub
      else
        if document.form1.check.value <>0 then
            document.form1.menuu.disabled=true
       end if
      end if
   end sub
</Script>
</HEAD>

<BODY>
    <form name="form1" method="post">
       <input type="radio" name="check" value="0">Experienced
       <input type="radio" name="check" value="1">Fresher
       <input type="radio" name="check" value="2">FinalYr

       <select name="menuu">
            <option value="0">0</option>
            <option value="1">1</option>
            <option value="2">2</option>
       </select>
</form>
</body>
</html>



     the error i am getting is
Object does'nt support this property or method:document.form1

  plz help me i am in need


MuthuKumar.AL
 
Old December 28th, 2004, 10:46 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Is there any specific reason to use Vbscript in client side script?

Om Prakash
 
Old December 29th, 2004, 01:54 AM
Authorized User
 
Join Date: Dec 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am working in vbscript and asp environment and hence i need to do this in vbscript..
so plz help if you know vbscript... plzzzz
thanx in advance
bye bye


MuthuKumar.AL





Similar Threads
Thread Thread Starter Forum Replies Last Post
Radio button gaurisharya C# 2005 2 March 16th, 2008 06:43 AM
radio button anwarraja Javascript 3 September 18th, 2007 08:18 PM
right click menu hidden by drop-drown menu Andraw HTML Code Clinic 0 March 18th, 2005 03:28 PM
Button acts depending on radio button values janise Access 4 March 10th, 2004 12:53 AM
radio button damnnono_86 Access 5 October 28th, 2003 02:17 AM





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