我正在尝试通过jquery创建一个select我可以创建输入,但由于某种原因我在<select>
上给了我错误。这是代码
var form1 = bootbox.confirm("<form id='infos' action=''>\
<label>Titulo:</label><input autocomplete=off type=text name='title' /><br/>\
<label>Turno</label><select name='select'>
<option value='value1'>Value 1</option>
<option value='value2'>Value 2</option>
<option value='value3'>Value 3</option>
</select><br/>\
<label></label><br/>\
<label></label><br/>\
<label></label><br/>\
</form>", function(result) {
if(result)
var nomestaff = document.getElementById("inputString").value;
var idstaff = document.getElementById("inputString2").value;
var title = form1.find("input[name=title]").val();
var turno = form1.find("input[name=turno]").val();
var start2 = $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss");
var end2 = $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss");
alert(start2);
$.ajax({
url: 'add_eventshorario.php',
data: 'title='+ title+'&start='+ start2 +'&end='+ end2 +'&url='+ utente +'&local='+ local +'&meiotransporte='+ meiotransporte +'&acompanhante='+ acompanhante +'&tipoconsulta='+ tipo_consulta +'&nomeutente='+ nomeutente ,
type: "POST",
success: function(json) {
alert(nomeutente);
location.reload();
答案 0 :(得分:0)
您必须escape
select string
,
...
<label>Turno</label><select name='select'>\
<option value='value1'>Value 1</option> \
<option value='value2'>Value 2</option>\
<option value='value3'>Value 3</option>\
</select><br/>\
....