handleSubmit: true (A broken code editor)

This example demonstrates the code editor example from YUI does not work when using handleSubmit: true.

The use case:

  1. Load this page
  2. Toggle to the code view
  3. Change the text below from "monkey" to "banana"
  4. Do NOT toggle to the WYSIWYG view
  5. Click Submit
  6. The alert box prompts the value that will be submitted: "monkey" (NOT the desired "banana")

The problem:

When you use handleSubmit, the textarea is updated with outdated information from the iframe before the form is submitted. The user must toggle to the WYSIWYG view to update the WYSIWYG.

See my first solution