473,396 Members | 2,113 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,396 software developers and data experts.

Programmatic onsubmit in IE

Hi,

I have a form, which is sometimes submitted by clicking a submit button, sometimes by enter being pressed in a field, and sometimes programmatically (By the clicking of a "Master Save" elsewhere on the page).

So I created an onsubmit event to do field validation. This works for the first two methods, but breaks for the third. (Ridiculously, the submit() function doesn't trigger onsubmit!)

To hack my way around that, I call the onsubmit event programatically too, but as the form is in an IFrame and the "Master Save" is in the parent page, I can't call the javascript function by name, and have to do this:

if (document.getElementById('IFrame1').contentDocumen t.forms[0].onsubmit())
document.getElementById('IFrame1').contentDocument .forms[0].submit();

This works fine in FF, but IE6 is giving me issues. I know, IE6 is ancient, I have no choice, that's the browser the company mandates.

Can anyone suggest why this is breaking, or how else I can call the function in the IFrame?

Thanks,
Rich
Oct 16 '08 #1
1 1685
Theh better way of acessing the element under the iframe tag is like
Expand|Select|Wrap|Line Numbers
  1. window.frames[0].document.getElementById('daLink').style.backgroundColor='#00000F'
where frames[0] says that it is the first Iframe of the page instead of that you can also give the name of the frame like frames['My new Frame']

This will work fine If you still have query please let us know .
Oct 16 '08 #2

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

Similar topics

4
by: Stuart Wexler | last post by:
Hi, I have a form with onSubmit embedded in the <form> tag. The form is submitted programatically through javascript . While the form submits fine, nothing I'm doing seems to get it to...
6
by: Blaine Manyluk | last post by:
I have a very unusual request. I need to be able to generate reports and save them as TIF files, with full programmatic control. The application will provide the filenames. Each page of the...
8
by: Mark Livingstone | last post by:
I have a form that uses the following: onSubmit="some_var = 'validated';" FireFox is OK with that. Internet Explorer isn't. any ideas why? Thanks.
8
by: Mark Livingstone | last post by:
I have a form that uses the following: onSubmit="some_var = 'validated';" FireFox is OK with that. Internet Explorer isn't. any ideas why? Thanks.
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.