0

我有这个文本字段

<?php if($row_questionset['Constructor']=="TextField"){?>

    <?php while ($row_Answer=mysql_fetch_array($AnswersValue)){ ?> 

    <fieldset class="field" >   
        <?php $question=$row_questionset['QuestionIDFKPK'];?>
            <span class="symbol">
                <?php echo $row_questionset['QuestionValue']; ?>
                <input class="validate[required] text-input" type="text" name="sampletextanswer<?= $row_Answer['QuestionIDFK'];?>[]" id=" < ?php echo $question ?> "  value="<?= $answerSelect=$row_Answer['AnswerIDPK'] ; ?>"  onblur="textfieldfocus()" <?php if ($row_Answer['UserAnswer']!='') {echo "checked=checked";} ?> >
            </span>
    </fieldset>

    <?php }  ?>

<?php } ?>

我尝试使用这些脚本将用户每次单击时在 texfield 上介绍的信息保存在表格中,但不起作用。我该怎么办?

<script>    
function textfieldfocus(){  

  var node_list = document.getElementsByTagName('input');

  for (var i = 0; i < node_list.length; i++) {
    var node = node_list[i];

    if (node.getAttribute('type') == 'text'){       
      UpdateItem('<?php echo $US_ID ?>;' + this.id + ';' + this.value);                                           
    }

  }

};
</script>
4

0 回答 0