私は次のコードを持っています:
<h3> Your Profile </h3>
The information below is what we have on file for you.
<form id="profileform" name="profileform" action="">
<table>
<?php
$profile_array = select_profile_data($_SESSION['id']);
while (list($key, $value) = each($profile_array)) {
if(!in_array($key,$dont_display_list,true)) {
echo '<tr><td>'.$key.'</td><td><input type="text" name=' . $key . ' value="'.$value.'"</td></tr>';
}
}
?>
</table>
<input type="button" value="submit changes" name="submit" onClick="button_click('profileform')">
</form>
<script type='text/javascript'>
function button_click(formname) {
var fullselect = formname + " :input";
alert(fullselect);
var values = $(fullselect);
alert(values.size());
$("#content").html('<span>Loading...</span>');
$("#content").load('profile.php', values, function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$("#content").html(msg + xhr.status + " " + xhr.statusText);
}
});
}
「fullselect」でのアラートは、予想されるjqueryセレクター文字列'profileform:input'を示しています。ただし、私の「values」変数は常に「0」のサイズを返します。フォームには間違いなく「入力変数」がありますが。私がここで間違っているところについて何か考えはありますか?
ありがとう、