Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2008
    Posts
    54
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Question drop down menu that opens div with 2 radio buttons

    How would I go about coding this? If they select No the div with the radios would open and be required.

    http://www.shoppingcartcash.com/

    http://www.shoppingcartcash.com/form.js

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,026
    Thanks
    36
    Thanked 494 Times in 488 Posts

    Lightbulb Consider this ...

    Try this ...

    Keep in mind that all ID='values' must be unique.
    Can not have, for example, two id='FieldData7' entries in the same script.

    Should not break <TABLE> rows using <DIV>.
    That's why I split the table display just before the hidden content.
    Keep whole table within the <DIV> tags.

    Code:
      <td>
    
       <select name="FieldData7select" id="FieldData7select"
     onchange="NoDataAccesDisplay(this.value)">
    
         <option value="">Select</option>
         <option value="Yes">Yes</option>
         <option value="No">No</option>
        </select>
    
    </td>
    </tr>
    </table>
    
    <div id="NoDataAccess" style="display="none">
    <table border="0">
    <tr>
    <td>
    
        <br> <br> 
        <span class="style3">If no, are you willing to pay a low cost developer if needed in order to switch to an open source cart where <em>you</em> manage the source code and customer database in order to save on monthly fees, get faster hosting in most cases, and get paid a guaranteed $1 per U.S. and Canada transaction?</span> (We can consult you for free on this.)<br>
    
    .....
    
                        </tr>
                      </table>
    </div>
    In the <HEAD> of the HTML add:
    Code:
    <script type="text/javascript">
    function NoDataAccessDisplay(choice) {
      if (choice == 'No') {
        document.getElementById('NoDataAccess').style.display = 'block';
      } else [
        document.getElementById('NoDataAccess').style.display = 'none';
      }
    }
    </script>
    Note 1. -- should remove ALL html in external .JS file (remove <!-- -->, etc)
    Note 2. -- script not tested

  • Users who have thanked jmrker for this post:

    johnwboyd (03-18-2009)

  • #3
    New Coder
    Join Date
    Feb 2008
    Posts
    54
    Thanks
    19
    Thanked 0 Times in 0 Posts
    Thanks but it doesn't work. Error messages in IE and div still showing in both browsers. Also I wanted to have 2 radio dial buttons within the div and the field names are FieldData7, FieldData8 respectively. I tried using FieldData7B before and the php had an error.

  • #4
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,026
    Thanks
    36
    Thanked 494 Times in 488 Posts

    Arrow More information needed ...

    Quote Originally Posted by johnwboyd View Post
    Thanks but it doesn't work. Error messages in IE and div still showing in both browsers. Also I wanted to have 2 radio dial buttons within the div and the field names are FieldData7, FieldData8 respectively. I tried using FieldData7B before and the php had an error.
    You either did not change or update the link to your program in the earlier post so I am seeing the same errors as before. Same problem with non-unique IDs etc.

    Just saying "Thanks but it doesn't work." is not much help.
    If you make changes how we know that that error is not elsewhere?
    If you want help, you need to help us.

  • #5
    New Coder
    Join Date
    Feb 2008
    Posts
    54
    Thanks
    19
    Thanked 0 Times in 0 Posts
    I am not seeing any errors as of now in IE.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •