%OnSubmit is not invoked from client
Hi Guys,
I've an fileupload and button that executes Upload() clientmethod to upload files in my database and everything works fine when I run the application in the server where it is located, but if I run it from a client machine the %OnSubmit class method doesn't get invoked when form.submit() get executed so how can I fix this?
I can always use <submit> button but the thing is that I need the current form to close after submitting the form but adding &js<window.close()> st the end of %OnSubmit classmethod to close the window is not working
<input type="file" size="80" name="FileStream" class="button" id="fileUpload" />
</html>
<image src="images/spacer.gif" width="10" height="1" />
<imageclickbutton id="btnUpload" caption="Upload" width="90" height="30" onclick="zenPage.Upload();"/>
{
zenSynchronousMode = true;
if (document.getElementById("fileUpload").value != "") {
var p1 = (document.getElementById("fileUpload").value).lastIndexOf("\\");
var fileName = (document.getElementById("fileUpload").value).substring(eval(p1) + 1, (document.getElementById("fileUpload").value).length);
zen("FileName").setProperty("value", fileName);
var form = zenPage.getComponentById("mainForm");
if (form) {
var ret=form.submit();
Thanks
Comments
What browsers are you using to do this? Many have restricted the use of window.close to only work on windows that were also opened by javascript using window.open.