Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 28th, 2004, 03:39 AM
Authorized User
 
Join Date: Dec 2004
Location: Chennai, TamilNadu, India.
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
Reply With Quote
  #2 (permalink)  
Old December 28th, 2004, 04:23 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
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
Reply With Quote
  #3 (permalink)  
Old December 28th, 2004, 06:24 AM
Authorized User
 
Join Date: Dec 2004
Location: Chennai, TamilNadu, India.
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
Reply With Quote
  #4 (permalink)  
Old December 28th, 2004, 08:37 AM
Authorized User
 
Join Date: Dec 2004
Location: Chennai, TamilNadu, India.
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
Reply With Quote
  #5 (permalink)  
Old December 28th, 2004, 10:46 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
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
Reply With Quote
  #6 (permalink)  
Old December 29th, 2004, 01:54 AM
Authorized User
 
Join Date: Dec 2004
Location: Chennai, TamilNadu, India.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.