javascript
  • php
  • jquery
  • jquery-mobile
  • checkboxlist
  • 2014-03-04 4 views 0 likes 
    0

    PHP 코드에서 jQuery를 모바일 체크 박스 그룹의 가치를 (필자는이 링크에 jQuery를 모바일 체크 박스 그룹에서 샘플 예제를 발견 http://jsfiddle.net/Palestinian/2yjgg/)내가 PHP 코드 jQuery를 모바일 코드에서 jQuery를 모바일 응용 프로그램에서 체크 박스 그룹의 값을 얻으려면

    <div data-role="page" id="attend" > 
    <p>Choose Student who attende:</p> 
    <div id='group_checkboxes'></div> 
    <form method="post" action="sign_up3.php" target="_new" > 
    <script> 
    $("#attend").live("pageinit",function(event){ 
    
    var checkboxes = ''; 
    for (i = 0; i <= 5; i++) { 
    checkboxes += '<input type="checkbox" id="foo' + i + '" class="custom" name="attend_list[]" /><label for="foo' + i + '">Foo checkbox' + i + '</label>'; 
        } 
        var controlgroup = $("<fieldset/>", {"data-role": "controlgroup"}).append(checkboxes); 
        $("#group_checkboxes").append(controlgroup.controlgroup()); 
        $("[type=checkbox]").checkboxradio(); 
        $("[data-role=controlgroup]").controlgroup("refresh"); 
        });      
    
    </script> 
        <input type="submit" value="submit" > 
    
        </form> 
    </div> 
    

    PHP 코드

    <?php 
    
        foreach($_POST['attend_list'] as $value) 
        { 
        echo $value ; 
        } 
    
        ?> 
    

    하지만 PHP 코드 쇼이 오류를 제출할 때

    "주의 : 정의되지 않은 인덱스 : C에서 attend_list : \ XAMPP \ htdocs를 \ AT & T는 \ sign_up3.php 라인에 3

    경고 : \ XAMPP \ htdocs를 \ ATT \ sign_up3.php : C에서 foreach는()에 대한 공급 잘못된 인수

    <div id='group_checkboxes'></div> 
    

    양식에 : 라인 3 "

    +0

    이 링크에서이 파일을 찾았습니다. http://jsfiddle.net/Palestinian/2yjgg/ – Beshoy

    답변

    0

    이동이에. I.E. 이 줄 끝

    <form method="post" action="sign_up3.php" target="_new" > 
    

    은 현재 요소가 양식에 포함되지 않은 체크 박스를 작성하는 방법, 그래서 제출할 때, 데이터는 양식 제출과 함께 전달되지 않습니다.

     관련 문제

    • 관련 문제 없음^_^