我正在尝试使用console.log()
在脚本中显示表单中的值以进行故障排除,但似乎无法正常工作。这是我的剧本。
有什么我想念的吗?
jQuery(document).ready(function() {
var user = jQuery('#id').val;
var file = jQuery('#custom-file-input').val;
console.log(file);
});
echo "<form method='post' enctype='multipart/form-data' id='test_ajax'>";
echo "<select name='id' id='form-option' class='test-only'>";
echo '<option selected="selected">' .'Choose a User'. '</option>';
foreach ($registeredUsers as $key => $value) {
$registered = JFactory::getUser($value);
echo '<option value="'.$registered->id.'">'.$registered->name.'</option>';a
}
echo "</select>";
echo "<input name='uploadedfile' type='file' id='custom-file-input' class='test-only' /> <br/>";
echo '<input type="submit" name="submit" value="Upload" id="custom-submit-input">';
echo "</form>";