We are using the Ajax.updater.  A php script determines the response
that is returned to the updater to be passed to the <div> for
updating. In the case that the success message is returned upon
successful form submission, we need some javascript to be processed as
well. I read in the docs that pure javascript returned gets eval'd and
processed, but that isn't what I am experiencing. The php function
that returns the script is:

public function etag_thanksQuickContact(&$domDoc) {
    return '<script type="application/
javascript">document.write("<h1>Thank You</h1><p>Thank you for
contacting us.</p>");</script>';

This is simplified to for testing purposes. The real script that I
want eval'd will include a few other statements, but I am using this
to make sure that the script is running properly.

The Ajax.updater javascript we have is:
function qcSubmit() {
  new Ajax.Updater('qcContent', '/h/contact/QuickContact', {
    parameters: {
      name: $F('name'),
      email: $F('email'),
      telephone: $F('telephone'),
      comment: $F('comment')

If I write the PHP function to just return the thank you text, and not
a javascript that prints it, then it returns fine. When I try to write
it with Javascript, it isn't eval'ing. What do I need to do

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to