#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 18 years ago by
Keywords: | submit removed |
---|
comment:2 Changed 18 years ago by
Component: | UI : Toolbar → General |
---|---|
Keywords: | Confirmed added |
Priority: | Low → Normal |
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 18 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
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 18 years ago by
Milestone: | → FCKeditor 2.4.3 |
---|
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.