On selecting an option from a select list i would like to retrieve data (html content) from mysql db according to selection and then replace everything inside my wysiwyg with that data.

I know i can insert at selection a predefined value (just any old text):

onChange="content.insertAtSelection (this.options[this.selectedIndex].value);"

(this is how i can take some text and add it inside the wysiwyg at the cursor)

How can i...

1/ do the ajax retrieve part?
2/ overwrite everything inside [this.selectedIndex]?