473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

document.forms[0].submit() function called from different location in IE6

Hello,
I have following code snippet:
Expand|Select|Wrap|Line Numbers
  1. ...
  2. function submitForm() {
  3.       document.forms[0].submit();
  4. }
  5. ..
  6.  
When I call this function when pressing "Add" button, everything works fine:

Expand|Select|Wrap|Line Numbers
  1. <form name="svnlink" method="post">
  2. ...
  3. <input type="button" value="Add" name="btn" onclick="submitForm();">
I need to call this submitForm() function from another javascript file but it doesn't work in IE6, it works correctly in IE7 and Firefox. What I need is to submit this form when user clicks one of items, which are dynamically created in different *.js file (I use there code: <a ... onclick="javascript:submitForm();>item_name</a>). I don't know how to make submit() function work in IE6.

Thanks for answer
Apr 2 '07 #1
2 9557
r035198x
13,262 8TB
Hello,
I have following code snippet:
Expand|Select|Wrap|Line Numbers
  1. ...
  2. function submitForm() {
  3. document.forms[0].submit();
  4. }
  5. ..
  6.  
When I call this function when pressing "Add" button, everything works fine:

Expand|Select|Wrap|Line Numbers
  1. <form name="svnlink" method="post">
  2. ...
  3. <input type="button" value="Add" name="btn" onclick="submitForm();">
I need to call this submitForm() function from another javascript file but it doesn't work in IE6, it works correctly in IE7 and Firefox. What I need is to submit this form when user clicks one of items, which are dynamically created in different *.js file (I use there code: <a ... onclick="javascript:submitForm();>item_name</a>). I don't know how to make submit() function work in IE6.

Thanks for answer

Try

[HTML] javascript:document.forms[0].submit();[/HTML]
Apr 2 '07 #2
Hi,
I have fixed it already. problem was, that I used
Expand|Select|Wrap|Line Numbers
  1. <a ... href="javascript:void(0);" onclick="javascript:document.forms[0].submit();">
When I added return statement, it works in IE6 as well:

Expand|Select|Wrap|Line Numbers
  1. <a ... href="javascript:void(0);" onclick="javascript:document.forms[0].submit();return false;">
Apr 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: lawrence | last post by:
Is this the correct way to test for a method before I use it? createRange() is, I believe, an IE only method. function wrapSelectionInTag(selection, tag) { if (document.selection.createRange)...
6
by: skubik | last post by:
Hi everyone. I'm attempting to write a Javascript that will create a form within a brand-new document in a specific frame of a frameset. The problem is that I can create the form and input...
3
by: davidkarlsson74 | last post by:
Error: document.getElementById("folderMenu").cells has no properties File: http://www.volkswagen.se/tillbehor/js/foldermenu.js Rad: 49 The function activates different DIV:s, but doesn't seem to...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
2
by: The Crow | last post by:
i have to catch submit event of the form contained in the asp.net webform. when a button on the page clicked, it works ok, but when i call form.submit() or linkbutton vs. calls __doPostBack() ,...
2
by: pantagruel | last post by:
As per the subject line, Firefox's error console says document.forms.submit is not a function. the javascript is function makequery(param){ document.forms.qu.value=param;...
19
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect...
3
by: KOFI QUANSAH | last post by:
Hello, 1) I have a php script A with several buttons(not submit) on a form. 2) On click of any of the buttons, a specific javascript function is called. 3) Depending on the outcome of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.