Jump to content

Search the Community

Showing results for tags 'selection'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 4 results

  1. Hi guys, I use a very big form and my variables will be saved in a session. In most cases I´m fine with PHP. Until now I just use JS to hide and show some options. My idea is to give the user a selection (somewhere in my form). As soon as the user clicks on one of the selection options, the value of the variable shall appear as text below the selection options (not just in the selection options). 1. Idea - import the php-variables in my JS and work with it <script type="text/javascript">var test ="<?php echo $test ?>";</script> --> didnt work. I could work with the variable, but I dont get a "fresh" variable from the session, because I would have to push the form button first. 2. Idea - create a JS variable in the selection options <selection id="test"><option value=test1">Test1</option><option value=test2">Test2</option>...</selection> --> didnt work. Do you have any ideas what I should look for or what I have to do? Thanks and cheers, Chrex
  2. Hello, I wanted my website's display area to be exactly 768 px centered on the page. So here's the css properties I applied to the "main" div that contains every element I add on my webpage: div#main { margin-left: auto ; margin-right: auto ; width : 768px ;} It works, fine, however when I select several lines of text inside it, the blue selection is bleeding all the way to the left and right of the window (see attached image). How can I prevent this from happening? Thanks for reading! Thomas
  3. For example, if you select the option with id="chocolate-yes" or id="vanilla-yes", the the option with id="icecreamcone-yes" will also be selected.As you can see on the image below, when you select the option with id="chocolate-yes", <select id="icecreamcone"> will be disabled. When both id="chocolate-yes" and id="vanilla-yes" are not selected the the option with id="icecreamcone-no" will not be disabled. To put it in simpler words: you always need to have an ice cream cone if you want to add vanilla or chocolate ice cream, with the exception of sprinkles Anyone know of a Javascript that can do this? Note 1: the option with id="sprinkles-yes" will not effect id="icecreamcone-yes".Note 2: id="icecreamcone-yes" need still be selectable prior to selecting id="vanilla-yes" or id="chocolate-yes".Note 3: id names cannot be changed, nor can you add more properties to the elements.Note 4: cannot use jQuery. <ul id="icecream" style="list-style:none;line-height:30px;"> <li> <select id="icecreamcone"> <option value="addicecreamcone">Would you like an ice cream cone?</option> <option id="icecreamcone-yes" value="yes">Yes</option> <option id="icecreamcone-no" value="no">No thanks</option> </select> </li> <li> <select id="vanilla"> <option value="addvanilla">Would you like to add vanilla ice cream?</option> <option id="vanilla-yes" value="yes">Yes</option> <option id="vanilla-no" value="no">No thanks</option> </select> </li> <li> <select id="chocolate"> <option value="addchocolate">Would you like to add chocolate ice cream?</option> <option id="chocolate-yes" value="yes">Yes</option> <option id="chocolate-no" value="no">No thanks</option> </select> </li> <li> <select id="sprinkles"> <option value="addsprinkles">Would you like to add sprinkles on top?</option> <option id="sprinkles-yes" value="yes">Yes</option> <option id="sprinkles-no" value="no">No thanks</option> </select> </li></ul>
  4. Hi there, I have 10 drop down boxes on a page where people can select some units they wish to study. Obviously people can pick more than one unit and so i want to avoid them from picking the same unit twice in each of the drop down boxes. I have looked into the disable function on drop down boxes but cannot figure out how i would go about disabling a drop down selection entry using Javascript. So far i have looked at the following jquery function below but it will not work on my php page as i do not have access to the head of the document on the platform i am on and just the body: $('select').change(function() { var ary = new Array(); $('select option:selected').each(function() { if ($(this).val().length > 0) { ary.push($(this).val()); } }); $('select option').each(function() { if ($.inArray($(this).val(), ary) > -1) { $(this).attr('disabled', 'disabled'); } else { $(this).removeAttr('disabled'); } });}); The example above is the sort of thing i am after but having studied the code, without it being in the head of the document it will not work and so it does not work when i change entry in the dropdown list. Does anybody have any modifications to the code or examples i can use to find out the values of all other dropdown's on a form and to then disable an index in the others where one is already selected on that index? Obviously i would need something to enable selections again. Even an alert box stating that the unit has already been picked and resetting back to original value would do. Many thanks, Mark
  • Create New...