【发布时间】:2013-09-24 11:04:26
【问题描述】:
这就是我想要得到的response14.php?questionID=1&question=yes&approved=1
这是我目前收到的response14.php?questionID=[object%20Object]&question=undefined&approved=1
这是js文件:
$(document).ready(function(){
$(".save_btn").on('click', function() {
var check = $("input[name=no]").is(":checked")?2:1;
var questionID = $("textarea[id=questionID]").val();
var question = $("textarea[value=question]").val();
location = "response14.php?questionID=" +questionID + "&question=" +question + "&approved=" +check;
这是渲染的 html:
<td style='border:1px white; padding: 5; margin: 5;'><div id='wrap'>
<textarea cols='85' rows='2' id='3792' class='response textbox'>Hello C!!
Where can I send you fan mail? :)
I want your autograph and I'm from the Philippines :)
God bless Cooper!</textarea>
YES: <input type='checkbox' name='yes' value='yes'>
NO: <input type='checkbox' name='no' value='no'> </div></td></tr><tr style='border:1px white; background-color:lightgrey; color:black; padding: 5; margin: 5;'><td style='border:1px white; vertical-align:top; padding: 5; margin: 5;'>Gavin Casalegno</td>
<td style='border:1px white; padding: 5; margin: 5;'><div id='wrap'>
<textarea cols='85' rows='2' id='3793' class='response textbox'>What is your religion?
Do you believe in God?
How much you measure height?</textarea>
YES: <input type='checkbox' name='yes' value='yes'>
NO: <input type='checkbox' name='no' value='no'> </div></td></tr></tbody></table><button type='button' class='save_btn' style='align:right'>Save All</button><br>
关于如何解决这个问题的任何想法???
【问题讨论】:
-
html是如何渲染的?
-
id 试试
var questionID = $("textarea").attr('id').val();值试试var question = $("textarea").val();
标签: javascript html pdo get textarea