我有这个文字字段
<?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>