• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Form is not submitting when I use the TAB for navigation

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have a problem while submitting the form through tab navigation.

in a form I have browse button(created using <input type="file"> tag) but this is hidden by a customized browse button as shown in the following code.

<form id="uploadform" name ="uploadform" method="post" enctype="multipart/form-data" action="<e:txDir />/SaveImageEvent"
target="logo_upload">

<input type="file" class="hide" id="datafileLogo" name="datafileLogo"
onChange="javascript:saveImage('repLogo','datafileLogo','logo_upload');"/>
<a href="javascript:repReportOptions.openFileWindow('datafileLogo')" id="likfileLogo"><img src="/browse_btn.gif" border="disabled"/></a>
</form>

//this method is used to open the file selection window on clicking the image above Browse image.
this.openFileWindow = function(objectId)
{
var flvar = document.getElementById(objectId);
flvar.click();
}


//this save image method is called when the user selects the image from the file window( on onChange) .Here I have to use the TAB navigation only to select and submit the selected file.
this.saveImage = function(imagePrefix,imageName,displayImageFrame)
{
var fileName = document.getElementById(imageName).value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
var thefile = fileSystem.getFile(fileName);
var size = thefile.size;

if(((fileType == ".gif") || (fileType == ".GIF")) && (size <= 1048576))
{
document.uploadform.imageType.value = fileType;
document.uploadform.imagePrefix.value = imagePrefix;
document.uploadform.fileOperation.value= 'saveImage';
document.uploadform.target = displayImageFrame;
document.uploadform.imagefileName.value = imageName;
document.uploadform.submit();
}
else
{
util.alert("Images must be .gif files less than 1MB is size. Click the information icon in the coverpage options section for more information.");
}

}


Here the problem is document.uploadform.submit(); line is not executing in the above saveImage () method(when I use TAB for selecting and submit the selected file from the file window) and all statements above the document.uploadform.submit() statement are executing properly.

When I use Mouse everything is working file. Please suggest a solution as this is killing me for the past 3 days.

 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hope you are using that code with IE only and with low security levels.

Eric
 
G.T. Reddy
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Eric. I am using IE only still I am not understanding your comment "low security levels".Could you please elaborate it and I would appreciate if you provide me the solution. Thanks
 
Are we home yet? Wait, did we forget the tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic