|
|
|
เรื่อง uploadify รบกวนหน่อย เกี่ยวกับการส่งตัวแปร ครับ |
|
|
|
|
|
|
|
Code (JavaScript)
$("#picchoice").uploadify({
auto : false,
height : 20,
fileSizeLimit : '200KB',
multi : false,
method : 'post',
formData : { pic : pic }
//uploadLimit : 1,
swf : '../js/uploadchoice/uploadify.swf',
uploader : '../js/uploadchoice/uploadify.php',
fileTypeExts : '*.jpg;',
onUploadSuccess : function(file, data, response) {
alert(data);
//window.location.reload();
},
onUploadError : function(file, errorCode, errorMsg, errorString) {
alert('The file ' + file.name + ' could not be uploaded: ' + errorString);
}
});
มันขึ้นว่า ไม่เห็นตัวแปร pic
Tag : PHP, HTML/CSS, JavaScript, Ajax, jQuery
|
|
|
|
|
|
Date :
2013-09-12 19:21:23 |
By :
kokiflam |
View :
689 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ต่อจากเมื้อกี้ครับ ผมทำให้มันกด click ก่อนด้วยครับ
Code (JavaScript)
$("#uploadchoice").click(function(){
alert(idtype);
var check = true;
var pic = "";
if(idtype == 1)
{
flowermain = $('input[id=flowermain]:checked').val();
color = $('input[id=color]:checked').val();
if(flowermain == "" && color == "")
check = false;
else
pic = flowermain+"-"+color;
}
else if(idtype == 2)
{
flowermain = $('input[id=flowermain]:checked').val();
if(flowermain == "")
check = false;
else
pic = flowermain;
alert(pic);
}
else
{
flowermain = $('input[id=flowermain]:checked').val();
vase = $('input[id=vase]:checked').val();
if(flowermain == "" && vase == "")
check = false;
else
pic = flowermain+"-"+vase;
}
if(check)
{
$("#picchoice").uploadify('upload');
}
});
|
|
|
|
|
Date :
2013-09-12 19:22:40 |
By :
kokiflam |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#picchoice").uploadify({
'onSelectOnce' : function(){
$('#picchoice').uploadifySettings('scriptData',{'pic':$('#pic').val()});
},
auto : false,
height : 20,
fileSizeLimit : '200KB',
multi : false,
method : 'post',
//formData : { pic : pic }
//uploadLimit : 1,
swf : '../js/uploadchoice/uploadify.swf',
uploader : '../js/uploadchoice/uploadify.php',
fileTypeExts : '*.jpg;',
onUploadSuccess : function(file, data, response) {
alert(data);
//window.location.reload();
},
onUploadError : function(file, errorCode, errorMsg, errorString) {
alert('The file ' + file.name + ' could not be uploaded: ' + errorString);
}
});
กดปุ่ม uploadใช้คำสั่ง
onClick="$('#picchoice').uploadifyUpload()"
|
|
|
|
|
Date :
2013-09-12 20:42:30 |
By :
somparn |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|