Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#450 closed defect (fixed)

Changes doesn't take effect without click on HTML-source-MODE

Reported by: rethus Owned by: gogo
Priority: highest Milestone: 2.0
Component: Plugin_Stylist Version: trunk
Severity: normal Keywords:


If i work with xinha in WYSIWYG-Mode, i had to change in HTML-SourceCode?-Mode (and back), before i save the changes.
Otherwise my changes didn't take any efects.

Change History (9)

comment:1 Changed 14 years ago by rethus

I forgot: My Browser is Firefox 1.04

comment:2 Changed 14 years ago by niko

could you post your setup?

or, best would be a testcase of your xinha-installation running on your website.

does IE work?

comment:3 Changed 14 years ago by mharrisonline

I had exactly this problem until I did this workaround:

function getnewHTML() {
  var html = "1";
  if (html) {
    form1.text_box.value = editor.getHTML();
<a href='' onClick=" getnewHTML();document.form1.in_action.value='Save';document.form1.submit(); return false;">Save button image goes here</a>

I'm using the old demo.html way of putting Xinha on the page, unchanged from when I used HTMLArea 3 so I don't lose the functionality of the buttons below the editor. For some reason, when I was using HTMLArea 3, I found that I could only get the updated value if I used an alert, an if statement, etc. It's pretty ugly, but it worked great after I had been frustrated for days trying to find a way to get the changes without viewing source. Weird, huh? I thought I was the only person that would ever see this problem.

comment:4 Changed 14 years ago by niko

that really looks strange :D

  var html = "1";
  if (html) {

the normal solution for your problem would be to call onsubmit:

document.form1.onsubmit(); //<<insert this function-call and it will work :D
return false;

...this is because xinha copies the html-code into the textarea in the onsubmit-event. and this event is only called when a submit-button in the form is pressed, and NOT wen the .submit()-function is called!
(yes, that IS strange, but the browsers behave like that :D)

comment:5 Changed 14 years ago by niko

@rethus: i think this is your problem too!

comment:6 Changed 14 years ago by ianb@…

I encountered this problem too (same resolution -- call form.onsumit() before form.submit()). Basically his workaround is doing almost exactly what Xinha does during onsubmit.

Should there be a "gotchas" page in the Wiki somewhere? (Or Debugging FAQ or something.) I don't see a good way to catch this particular case and warn the developer.

comment:7 Changed 14 years ago by mharrisonline

After days of it not working, (and only seeing it work when submit made an alert in the demo) I was all to happy follow the rule of "If it works, don't, er, mess with it."

I'm glad to finally know now how it is really supposed to work...

comment:8 Changed 14 years ago by niko

  • Resolution set to fixed
  • Status changed from new to closed

comment:9 Changed 13 years ago by anonymous

  • Component changed from Xinha Core to Plugin - Stylist
  • Milestone set to 2.0
  • Version set to trunk

maine name is aljek

Note: See TracTickets for help on using tickets.