?
Solved

javascript events

Posted on 2014-08-12
7
Medium Priority
?
152 Views
Last Modified: 2014-08-16
I guess I'm needing some baby steps to get through a project I'm working on.
I have a form that I'm trying to auto-upload a file to.  I'm accomplishing this by attempting to override the submit event beforehand, and drop the file path info in there before actually submitting it.
So far, it's not working.
I've tried attaching an event handler to onsubmit and onclick, but when I invoke the click event of the button (actually a # anchor), it flags a script error before jumping to my handler.
Is there another event I should be trying first?  onNavigate?  I just don't know...
0
Comment
Question by:sirbounty
  • 4
  • 3
7 Comments
 
LVL 67

Author Comment

by:sirbounty
ID: 40256467
This is the anchor I'm trying to click/execute:

<a href="#" onclick="return oamSubmitForm('zdmSummaryDetailsSubview:relContentViewpc1:tabZDMService:tabZDMServiceSettings:zdmDetailsForm','zdmSummaryDetailsSubview:relContentViewpc1:tabZDMService:tabZDMServiceSettings:zdmDetailsForm:saveZDMSessionConfig');" id="zdmSummaryDetailsSubview:relContentViewpc1:tabZDMService:tabZDMServiceSettings:zdmDetailsForm:saveZDMSessionConfig" class="ButtonLeft"><div class='ButtonRight'><div class='ButtonMiddle'>Save</div></div></a>
0
 
LVL 58

Expert Comment

by:Gary
ID: 40256468
You can not with scripting set the file upload path, it has to be initiated by the Upload button in the form.
This is a security measure of all browsers.

edit
Maybe I'm misunderstanding you
0
 
LVL 67

Author Comment

by:sirbounty
ID: 40256544
Sure, I've learned that, but there is technically a way around it...
http://www.codeproject.com/Articles/28917/Setting-a-file-to-upload-inside-the-WebBrowser-com
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 58

Expert Comment

by:Gary
ID: 40256602
That is a webbrowser control not a browser and the code is 6 years old
0
 
LVL 67

Author Comment

by:sirbounty
ID: 40257969
Even so, surely there's a way to capture the submission beforehand...
I have it mostly working, it's just not finalizing somehow.  Running fiddler it tells me that it was expecting xxxx bytes, but the client sent 0, so even though the session appears correct, it's not getting passed.
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 40258345
Client sent 0 should be the clue
0
 
LVL 67

Author Closing Comment

by:sirbounty
ID: 40265300
I still think it's possible, but thanks for the comments.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question