Home > Backend Development > PHP Tutorial > php form表单里的判断,该如何解决

php form表单里的判断,该如何解决

WBOY
Release: 2016-06-13 13:51:56
Original
907 people have browsed it

php form表单里的判断
{{foreach from=$selectAry item=select}}
{{if $select.id == sid}}
  {{$select.name}}
{{/if}}
{{/foreach}}
我这里循环输出了但是我让想他输出一个是对应我这个表单里的id的我怎么样做判断,我现在这样的判断一个都输不出来了
如果把判断去了就输出两个

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--> 
Copy after login

{{foreach from=$selectAry item=select}} {{if $select.id == sid}} {{$select.name}} {{/if}} {{/foreach}}  php form表单里的判断,该如何解决  php form表单里的判断,该如何解决



JScript code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
function sendData(){
    var uid=document.getElementById('hidden_uid').value;
    var sid = document.getElementById('hidden_sid').value;
    var text = document.getElementById('part_text').value;
    var rideo = document.getElementsByName('part[is_good]');
    var is_good;
    if(text == '' || text == '输入您的看法,字数在50字内'){
        alert('请提出您的看法,不然投票无效哦!');
        return false;
    }
    alert (sid);
    for(var i=0; i<rideo.length if true is_good="rideo[i].value;" var url="http://www.h-elab.com/ajax/part/recode.php" return></rideo.length>
Copy after login


------解决方案--------------------
你给 form 一个唯一标识 嘛
又是 js、又是 jquery 一点团精神都不讲
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template