#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    4
    Rep Power
    0

    Checkbox checked


    I want!
    1. If I press "mark" then coming up <select></select> options.
    2. Click Choice then hidden select options and change mark
    3. Here is three out (checkbox) and if I click one, then change mark > choice and coming up select options.
    4. Eng bad, Thanks


    http://img547.imageshack.us/img547/6983/checked.png

    Code:
     
    <select name="answer" id="answer1">
    <option value="yes">Yes</option>
    <option value="no">No</option>
    </select>
    Code:
    <script type="text/javascript">
    var checkflag = "false";
    function check(field) {
      if (checkflag == "false") {
        for (i = 0; i < field.length; i++) {
          field[i].checked = true;
        }
        checkflag = "true";
        return "Choice";
      } else {
        for (i = 0; i < field.length; i++) {
          field[i].checked = false;
        }
        checkflag = "false";
        return "Mark";
      }
    }
    
    </script>
    
    <form name=myform action="" method=post>
    <table>
      <tr><td>
        <br>
        <input type=checkbox name=list value="1"><br>
        <input type=checkbox name=list value="2"><br>
        <input type=checkbox name=list value="3"><br>
        <br>                                                    
        <input type=button value="Mark" onClick="this.value=check(this.form.list)"> 
      </td></tr>
    </table>
    </form>
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    50
    Rep Power
    35
    It's kinda hard to understand exactly what you're after but is it anything like this? http://jsfiddle.net/M6wKX/
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    4
    Rep Power
    0
    Yes but one of the function more.
    Click Mark = select all checkbox.
    Then is done.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    50
    Rep Power
    35
    Soo something like http://jsfiddle.net/M6wKX/1/
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    4
    Rep Power
    0
    Little more...

    Click Choice = unchecked (Going back to the old position)
  10. #6
  11. No Profile Picture
    Super Moderator
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,009
    Rep Power
    2791
    verba, Edge360 has given you 99% of what you asked for, are you not going to attempt to solve the last part for yourself?
    [PHP] | [Perl] | [Python] | [Java] != [JavaScript] | [XML] | [C] | [C++] | [LUA] | [MySQL] | [FirebirdSQL] | [PostgreSQL] | [HTML] | [XHTML] | [CSS]

    W3Fools - A W3Schools Intervention.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    4
    Rep Power
    0
    I got it. Now I'm programmer?
    Very thanks, Edge360.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2010
    Posts
    1
    Rep Power
    0
    The easiest way to achieve this is using jQuery, it's pretty simple :

    Code:
    jQuery('input').prop('checked');

IMN logo majestic logo threadwatch logo seochat tools logo