|
Rank: Member Groups: Member
Joined: 7/12/2007 Posts: 24
|
I would like to use the AJAXUploader sample found in this demo but with the difference that it will be part of a more extensive form where my user can upload or not. The think is that the upload button to trigger the postback only is activated when some file is specified. Any way of achieving this ?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You will need to use JavaScript to do that. The basic idea is to use your own upload button, then when user clicks the upload button, you start uploading by calling the uploader's upload method: http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.AJAXUploader.upload.htmlThanks!
|
|
Rank: Member Groups: Member
Joined: 7/12/2007 Posts: 24
|
When you say "you own upload button". Is it any type of button ? I added one but the upload doesn't look to fire. The alert shown below do appear. Quote:
<input ID="Button1" type="button" value="button" onclick="return Button1_onclick()" />
function Button1_onclick() { alert('1') var uploader = eo_GetObject("AJAXUploader1"); uploader.upload() alert('2') }
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We tested your code and it works fine here. Do you have the page online so that we can take a look?
Thanks
|
|
Rank: Member Groups: Member
Joined: 7/12/2007 Posts: 24
|
You're right it was working but I didn't notice because I was expecting the AJAXUploader1_FileUploaded event to fire off but as I didn't have a file to upload this event wasn't triggered, which sounds pretty logic.
|
|