By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,687 Members | 2,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,687 IT Pros & Developers. It's quick & easy.

Help: Object doesn't support this action IE

P: n/a
I'm having some problems calling a JS function with a form button.

My function looks like this:
function selection(modify, id) {
document.frmNews.hideID.value = id;
document.frmNews.hideType.value = modify;
document.frmNews.submit();
}

The button:
<input type="button" name="btnEdit2" value="Edit"
OnClick="selection('edit', 2)" />

The button works if I change it's type to a "submit" but that seems to
skip the whole function and just submits.

Am I missing something?

Thanks,
Chris
Aug 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Chris wrote:
I'm having some problems calling a JS function with a form button.

My function looks like this:
function selection(modify, id) {
document.frmNews.hideID.value = id;
document.frmNews.hideType.value = modify;
document.frmNews.submit();
}

The button:
<input type="button" name="btnEdit2" value="Edit"
OnClick="selection('edit', 2)" />

The button works if I change it's type to a "submit" but that seems to
skip the whole function and just submits.

Am I missing something?

Thanks,
Chris


I figured out my own problem, it just took a long time. I'll leave this
post here for those who run into the same problem:

The problem was the name of the function. It seems that in IE a
function called "selecction" is bad news. I just changed the name of
the function to "choice" and everything works like it should. Talk
about bad luck in name selection. I'm thinking of naming my functions
f1, f2... f1000 just because I know they won't be key words :)
Aug 18 '05 #2

P: n/a
Chris wrote:
Chris wrote:
I'm having some problems calling a JS function with a form button.

My function looks like this:
function selection(modify, id) {
The problem was the name of the function. It seems that in IE a
function called "selecction" is bad news.


I had the same problem with the function log once :(
Aug 18 '05 #3

P: n/a
Chris wrote:
Chris wrote:
I'm having some problems calling a JS function with a form button.

My function looks like this:
function selection(modify, id) {
The button:
<input type="button" name="btnEdit2" value="Edit"
OnClick="selection('edit', 2)" />


Oh I forgot. Use "onclick" instead of "OnClick". It will make it XHTML
compliant.
Aug 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.