Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#493 closed Bug (fixed)

Submit button issue - naming conflict

Reported by: Mike Tonks Owned by:
Priority: Normal Milestone: FCKeditor 2.4.3
Component: General Version: FCKeditor 2.4.2
Keywords: Confirmed Cc:

Description

I just spent a good few hours over a problem with the Save button on the toolbar not working.

I eventually tracked down the problem, so I thought I'd post this in case it's of any help or even worth considering a change to the code to get around it.

The problem is with the html code for my submit button:
1) <input type="submit" value="Save" /> - toolbar save button works
2) <input type="submit" name="submit" value="Save" /> - toolbar save button does not work

3) <input type="submit" name="submit2" value="Save" /> - toolbar save button works

So the bug (2) is some sort of conflict over the name "submit". The javascript error is:

Error: A.submit is not a function Source File: http://phpmap-local/php/fckeditor/editor/js/fckeditorcode_gecko.js Line: 66

Browser: Firefox 1.5 linux

My suggestion would be to name whatever it is in the code fck_submit or something to make name conflicts less likely - naming my submit button 'submit' is not that unlikely.

Change History (5)

comment:1 Changed 17 years ago by Alfonso Martínez de Lizarrondo

Keywords: submit removed

That code is calling form.submit(), but in Firefox if you try to call that method and the form has an element named "submit" then it does tries to call that element. See https://bugzilla.mozilla.org/show_bug.cgi?id=148725

I don't see an easy solution to make it work, unless there's other way to call the real submit() method of the form.

comment:2 Changed 17 years ago by Frederico Caldeira Knabben

Component: UI : ToolbarGeneral
Keywords: Confirmed added
Priority: LowNormal

I don't see much chances to fix this thing too... what we could do for now, is to at least display an alert (to be fired by the Save button) if FCKeditor is placed inside a form with no submit function. At least the developer would be aware of the issue.

comment:3 Changed 17 years ago by Alfonso Martínez de Lizarrondo

Resolution: fixed
Status: newclosed

Fixed with [328], I've realized that we can call just the click() method of that button and it does the job fine.

comment:4 Changed 17 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.4.3

comment:5 Changed 17 years ago by Mike Tonks

Thanks for the quick response - good work.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy