양식이 제출되고 오류 (jquery 유효성 검사를 통해)가있을 때 일련의 체크 박스가 있는데, 분명히 유지해야하는 확인란의 상태가 필요합니다. 다시 입력 : I이 옵션 중 하나를 선택한 경우 내가 2 또는 3, 그것은 저장하지 않습니다를 선택하면 어떤 이유체크 박스 상태가 양식 제출시 지속되지 않음
<fieldset class="group">
<label for="s_type" class="mandatory full-width <?=$errors['s_type']?>"><strong>Please indicate which you are applying for:</strong></label>
<span class="clear"></span>
</fieldset>
<fieldset class="group">
<div class="field">
<input <?php if($s_type == "Fund Scholarship") { echo 'checked';} ?> type="checkbox" value="Fund Scholarship" name="s_type[]" id="s_type_fund" validate="required:true">
<label>Fund Scholarship</label><br/>
<input <?php if($s_type == "Foundation Scholarship") { echo 'checked';} ?> type="checkbox" value="Foundation Scholarship" name="s_type[]" id="s_type_foundation">
<label>Foundation Scholarship</label><br />
<input <?php if($s_type == "Memorial Scholarship") { echo 'checked';} ?> type="checkbox" value="Memorial Scholarship" name="s_type[]" id="s_type_mem">
<label>Memorial Scholarship</label><br />
<label class="error" for="s_type[]">This field is required</label></div>
</fieldset>
, 그에만 저장? 내가 무엇을 놓치고 있는지 잘 모르겠다.
편집 : 오, 내가 하나 이상을 선택하면 그 상태를 잃어 버린다.
편집 : $ s_type == "기금 장학금"내가 모델 가정으로 다른 PHP 페이지에서 작동 사용하고 있는데 왜
$s_type = implode("; ", $_POST['s_type']);
나는 그게 가정 : 난 그냥 코드의 맨 위에 다음 것을 깨달았다 이 하나
를 시도? – makapaka