Jump to content

marcus

Members
  • Posts

    1,842
  • Joined

  • Last visited

Posts posted by marcus

  1. $sql = "SELECT * FROM `urls` ORDER BY RAND()";
    $res = mysql_query($sql) or die(mysql_error());
    $row = mysql_fetch_assoc($res);
    echo "<frame src=\"{$row['url']}\" frameborder=\"0\" width=\"500\" height=\"auto\" scrolling=\"yes\">your browser does not support frames</frame>\n";
    

  2. <SCRIPT LANGUAGE="JavaScript">
    function anyCheck(form) {
    var total = 0;
    var max = form.checkboxes.length;
    for (var idx = 0; idx < max; idx++) {
    if (eval("document.form.checkboxes[" + idx + "].checked") == true) {
        total += 1;
       }
    }
    if(total >= 2) {
    return TRUE;
    }else {
    alert("Please select atleast two boxes")}
    }
    }
    </script>
    
    <form method="post" name="test" onSubmit="anyCheck(this.form)">
    1<input type=checkbox name="checkboxes[]">
    <br>2<input type=checkbox name="checkboxes[]">
    <br>3<input type=checkbox name="checkboxes[]">
    <br>4<input type=checkbox name="checkboxes[]">
    <br>5<input type=checkbox name="checkboxes[]">
    <br>6<input type=checkbox name="checkboxes[]">
    <br>7<input type=checkbox name="checkboxes[]">
    <br>8<input type=checkbox name="checkboxes[]">
    <br>9<input type=checkbox name="checkboxes[]">
    <input type="submit">
    </form>
    

     

    you could try that.

    http://javascript.internet.com/forms/checkbox-counter.html

  3. $checkboxes = $_POST['checkboxes'];
    
    if(count($checkboxes) >= 2){
    //allow
    }else {
    echo "you must select 2 or more to continue";
    }
    

     

    <input type="checkbox" name="checkboxes[]" value="1">
    <input type="checkbox" name="checkboxes[]" value="2">
    <input type="checkbox" name="checkboxes[]" value="3">
    <input type="checkbox" name="checkboxes[]" value="4">
    

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.