Показать сообщение отдельно

  #2  
Старый 11.11.2009, 22:43
diGriz
Участник форума
Регистрация: 11.10.2006
Сообщений: 134
Провел на форуме:
3607644

Репутация: 235
По умолчанию

Попробуй так:
Код:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> 
<script> 
function button(){ 
			if($('#1c').is(':checked') || $('#2c').is(':checked')){ 
			        //alert($('.c').val()); 
			        //$("#2c").attr("checked",""); 
					return true;
			    }else{ 
					alert('Пожалуйста, выберите из списка для выключить'); 
					return false;
			    } 
} 
</script> 

<form method="post" id="form" action="test.php" onsubmit="return button(this);"> 

    <input type="checkbox" checked name="allbox[]" id="1c" value="1"> 
    <input type="checkbox" checked name="allbox[]" id="2c" value="2"> 
	<input type="submit" name="submit" value="Выключить" id="on"><br><br> 
</form>  
<?php
if($_POST['submit'])   
{ 
    if(!$_POST['allbox']==""){ 
        foreach($_POST['allbox'] as $key){ 
            echo $key; 
        } 
    } 
} 
?>

Последний раз редактировалось diGriz; 11.11.2009 в 23:37..