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 August 17th, 2004, 09:08 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default how to enable dropdown by checking in on of the 3

<HTML>

<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>Search for a teammate!</title>
</HEAD>

<BODY bgColor="#FFFFFF" background="phones.gif">
<div align="center"><center>
<table border="0" width="525" bgcolor="#FFFFFF" cellspacing="0" cellpadding="5"
style="border: 8px outset rgb(0,0,0)">
  <tr><td width="50%"><strong><big><big>1.</big></big> Select a category to
    search</strong></td>
    <td rowspan="3" bgcolor="#000000" align="center" width="50%"><strong><p
    align="center"><img src="globe3.gif" width="216" height="139"
    alt="globe3.gif (10540 bytes)" align="right"></strong></td>
  </tr>
  <tr>
    <td width="262"><strong><big><big>2.</big></big> Type search criteria</strong></td>
  </tr>
  <tr>
    <td width="262"><big><strong><big>3.</big></strong> </big><strong>Submit
    Your Request</strong></td>
  </tr>
  <tr>
    <td width="515" bgcolor="#800000" colspan="2"><form action="DaEngine.asp" method="post"
    name="DaForm" align="center">
      <p>&nbsp;</p>
      <div align="center"><center><table border="1" width="350" cellpadding="3"
      bgcolor="#800000">
        <tr>
          <td align="left" width="189">
      <select name="spokes" size="1">
        <option SELECTED VALUE="none">None</option>
        <option VALUE="spoke 1">spoke 1</option>
        <option VALUE="spoke 2">spoke 2</option>
        <option VALUE="spoke 3">spoke 3</option>
        <option VALUE="spoke 4">spoke 4</option>
        <option VALUE="spoke 5">spoke 5</option>
        <option VALUE="spoke 6">spoke 6</option>
        <option VALUE="spoke 7">spoke 7</option>
        <option VALUE="spoke 8">spoke 8</option>
        <option VALUE="spoke 9">spoke 9</option>
        <option VALUE="spoke 10">spoke 10</option>
        <option VALUE="spoke 11">spoke 11</option>
        <option VALUE="spoke 12">spoke 12</option>
        <option VALUE="spoke 13">spoke 13</option>
        <option VALUE="spoke 14">spoke 14</option>
        <option VALUE="spoke 15">spoke 15</option>
        <option VALUE="spoke 16">spoke 16</option>
        <option VALUE="spoke 17">spoke 17</option>
        <option VALUE="spoke 18">spoke 18</option>
        <option VALUE="spoke 19">spoke 19</option>
        <option VALUE="spoke 20">spoke 20</option>
        <option VALUE="spoke 21">spoke 21</option>
        <option VALUE="spoke 22">spoke 22</option>
      </select><br>
      You may choose from the 22 spokes (for a definition of what a "spoke" is go to <a href="http://www.biblewheel.com">www.biblewheel.com</a>)
      <p class="MsoNormal"><o:p><input TYPE="CheckBox" NAME="book_spoke" VALUE="Book_Spoke">Book
      Spoke<br>
      <input TYPE="CheckBox" NAME="chapter_spoke" VALUE="chapter_spoke">Chapter
      Spoke<br>
      <input TYPE="CheckBox" NAME="verse_spoke" VALUE="verse_spoke">Verse Spoke<o:p>
      </o:p>
      </p>
      <p class="MsoNormal">&nbsp;<o:p>
      </o:p>
      </p>
      <p class="MsoNormal"><br>
      </o:p>
      </p>
    </td>
<td colspan="2" align="center" width="507"><div align="left"><p><input type="submit"
          name="B1" value="Search the Phone Directory!"><input type="reset" name="B2" value="Clear">
          </td>
  </tr>
</FORM>
</BODY>
</HTML>

 
Old August 17th, 2004, 11:02 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

You can call javascript function in onclick event of checkbox to enable/disable the dropdown. the code will be something like:

<SCRIPT LANGUAGE=javascript>
<!--
    function Validate()
    {
     if(document.form1.radio1.checked)
        document.form1.select1.disabled=false;
     else
         document.form1.select1.disabled=true;
    }
//-->
</SCRIPT>
Hope this helps..


Om Prakash
 
Old August 17th, 2004, 11:14 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

What I have is a code that I worked from a model code. I have a dropdown and three checkboxes. WHat I need is to enable the dropdown by checking on one or more of the three checkboxes. But when nothing is checked I want it disabled.



 
Old August 18th, 2004, 12:03 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

In that case you need to call the same javascriipt function from all three check boxes and check if any one of them is checked. If it is checked, then you have to enable the checkbox.


Om Prakash
 
Old August 18th, 2004, 01:15 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

what's wrong with this om_prakash? I tried to insert your code but didn't work.

Code:
<html>
<head>
<script type="text/javascript">

function Validate()
{
var x=document.getElementById("mySelect")
if x.checked
x.disabled=false
else
x.disabled=true
}
</script>
</head>

<body Onload="Javascript:Disable();">
<form>
<select id="mySelect">
    <option>Apple</option>
    <option>Banana</option>
    <option>Orange</option>
</select>
<input type="checkbox" onclick="Validate()" name="checkbox" value="Enable list">
</form>
</body>

</html>


 
Old August 18th, 2004, 03:54 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the following code:

<html>
<head>
<script type="text/javascript">
function Validate()
{
    var x=document.getElementById("checkbox1")
    var y=document.getElementById("mySelect")
    if(x.checked)
        y.disabled=false
    else
        y.disabled=true
}
</script>
</head>

<body onload="document.form1.mySelect.disabled=true;">
<form id=form1 name=form1>
<select id="mySelect">
    <option>Apple</option>
    <option>Banana</option>
    <option>Orange</option>
</select>
<input type="checkbox" onclick="Validate()" name="checkbox1" value="Enable list">
</form>
</body>
</html>


Om Prakash





Similar Threads
Thread Thread Starter Forum Replies Last Post
Enable Property kekec3778 Beginning VB 6 2 January 8th, 2008 06:32 AM
Enable Update and Enable Delete check boxes don't mihabib ASP.NET 2.0 Basics 2 December 7th, 2006 11:44 AM
Enable - Macros alannoble26 Excel VBA 2 November 28th, 2005 09:08 AM
Enable Assertions ssmith71 BOOK: Beginning Java 2, JDK 5 Edition 0 June 3rd, 2005 12:03 PM





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