Click here to Skip to main content
15,921,694 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: HTML fo uploading image file Pin
Nathan Minier10-Jan-17 6:43
professionalNathan Minier10-Jan-17 6:43 
Well, a lot of it has to do with the fact that you're applying a synchronous methodology to an asynchronous construct. Event handlers do not block the main thread, they run in their own context.

That means that the form is being submit before any file is actually chosen.The better route is to use an event handler.
JavaScript
$('#file').change(function(){
   $('#theForm').submit();
});

Then your HTML could look something like:
HTML
<form id="theForm" target='_self' action='upload.php' method='post' enctype='multipart/form-data'>
        <input style='display:none' type='file' accept='.jpg' name='file' id='file'/>
        <input type='hidden' name='id_utente' value='".$user['id']."' /><br />
        <input type='button' value='Scegli file da PC' onClick="$('#file').trigger('click');" /><br />
</form>
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli

GeneralRe: HTML fo uploading image file Pin
FilippoCSM10-Jan-17 9:20
FilippoCSM10-Jan-17 9:20 
QuestionWCF Service consumed through browser but NOT with WCFClient Pin
MrKBA5-Jan-17 20:17
MrKBA5-Jan-17 20:17 
AnswerRe: WCF Service consumed through browser but NOT with WCFClient Pin
Nathan Minier6-Jan-17 1:25
professionalNathan Minier6-Jan-17 1:25 
GeneralRe: WCF Service consumed through browser but NOT with WCFClient Pin
MrKBA6-Jan-17 1:57
MrKBA6-Jan-17 1:57 
GeneralRe: WCF Service consumed through browser but NOT with WCFClient Pin
Nathan Minier6-Jan-17 3:50
professionalNathan Minier6-Jan-17 3:50 
GeneralRe: WCF Service consumed through browser but NOT with WCFClient Pin
MrKBA6-Jan-17 4:45
MrKBA6-Jan-17 4:45 
QuestionSignalR on IIS Not Working Pin
Kevin Marois5-Jan-17 13:08
professionalKevin Marois5-Jan-17 13:08 
AnswerRe: SignalR on IIS Not Working Pin
ZurdoDev6-Jan-17 5:50
professionalZurdoDev6-Jan-17 5:50 
GeneralRe: SignalR on IIS Not Working Pin
Kevin Marois6-Jan-17 5:51
professionalKevin Marois6-Jan-17 5:51 
GeneralRe: SignalR on IIS Not Working Pin
ZurdoDev6-Jan-17 5:54
professionalZurdoDev6-Jan-17 5:54 
GeneralRe: SignalR on IIS Not Working Pin
Kevin Marois6-Jan-17 6:04
professionalKevin Marois6-Jan-17 6:04 
GeneralRe: SignalR on IIS Not Working Pin
ZurdoDev6-Jan-17 6:57
professionalZurdoDev6-Jan-17 6:57 
GeneralRe: SignalR on IIS Not Working Pin
Kevin Marois6-Jan-17 6:05
professionalKevin Marois6-Jan-17 6:05 
QuestionRe: SignalR on IIS Not Working Pin
ZurdoDev6-Jan-17 6:58
professionalZurdoDev6-Jan-17 6:58 
AnswerRe: SignalR on IIS Not Working Pin
Kevin Marois6-Jan-17 7:02
professionalKevin Marois6-Jan-17 7:02 
GeneralRe: SignalR on IIS Not Working Pin
ZurdoDev6-Jan-17 7:10
professionalZurdoDev6-Jan-17 7:10 
GeneralRe: SignalR on IIS Not Working Pin
Kevin Marois6-Jan-17 7:34
professionalKevin Marois6-Jan-17 7:34 
QuestionSignalR Error Handling Problem Pin
Kevin Marois3-Jan-17 12:00
professionalKevin Marois3-Jan-17 12:00 
AnswerRe: SignalR Error Handling Problem Pin
Kevin Marois3-Jan-17 12:27
professionalKevin Marois3-Jan-17 12:27 
QuestionCSS & Javascript in Accelerated Mobile Pages(AMP) Pages Pin
ali akbar.jpm1-Jan-17 19:50
ali akbar.jpm1-Jan-17 19:50 
QuestionBrowser based application without dependence on a particular browser Pin
Schatak28-Dec-16 19:38
professionalSchatak28-Dec-16 19:38 
AnswerRe: Browser based application without dependence on a particular browser Pin
Kornfeld Eliyahu Peter28-Dec-16 20:26
professionalKornfeld Eliyahu Peter28-Dec-16 20:26 
AnswerRe: Browser based application without dependence on a particular browser Pin
Afzaal Ahmad Zeeshan29-Dec-16 5:56
professionalAfzaal Ahmad Zeeshan29-Dec-16 5:56 
GeneralRe: Browser based application without dependence on a particular browser Pin
Schatak2-Jan-17 2:13
professionalSchatak2-Jan-17 2:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.