0
我想通过jquery ui模式上传图片..通过jquery ui模式上传图片
有可能吗?我有关于如何从模态值问题..
我一直在寻找通过网络,但目前还没有明确的答案..
做任何人有任何想法?
这是我的模式窗体的JavaScript代码:
$("#dialog").dialog({
modal: true,
resizable: false,
width: 400,
position: "center",
buttons: {
"Upload": function() {
var pos= $("#pos input:radio:checked").val();
// i still don't know how to get the value for the image uploaded
$(this).dialog("close");
},
"Cancel": function() { $(this).dialog("close"); }
}
});
});
这是我的模式形式:
<div id='dialog' title='ADD IMAGE' class='ui-dialog-content ui-widget-content'>
<form id='myform' method='POST' enctype='multipart/form-data'>
<fieldset>
<div id='pos'>
<p class='applyimage'>Where do you want to apply a background image?</p>
<p class='applyimage'><input type='radio' class='position' name='position' id='header' value='header' checked='checked'/> <label for='header'>Header</label>
<input type='radio' class='position' name='position' id='body' value='body'/> <label for='body'>Body</label>
<input type='radio' class='position' name='position' id='footer' value='footer'/> <label for='footer'>Footer</label></p>
<p class='applyimage'><input type='file' name='data[Image][fileName]' id='imgup'/></p>
</div>
</fieldset>
</form>
</div>