Welcome to WebmasterWorld Guest from 54.166.54.215

Forum Moderators: open

Problem with a function called as part of Ajax.Updater response

   
10:24 am on Aug 28, 2007 (gmt 0)

5+ Year Member



I'm giving my user the ability to set up usergroups - the groups data is stored in MYSQL and is passed there using PHP.

Before users can be added to the group, the group must be named and submitted to the DB and validated (ie: alphanumeric only, no existing entries with the name)

To keep a good flow to this procedure, I'm using Ajax.Updater - this returns a success or failure message to the user based on the validation mentioned above.

if the group is successfully created, I want to call a javascript function which reveals the member list - members can then be added to the group.

The problem I'm having is the function isn't being triggered - if successful Ajax.Updater returns

<div class="success"> GROUPNAME SUCCESSFULLY CREATED - YOU CAN NOW ADD USERS TO THIS GROUP</div>
<script type="text/javascript">
// <![CDATA[
new ShowUsers()
// ]]>
</script>

I know the function works ok as it runs if I hardcode this script into the page containing the form.

Can anyone advise why this is? Is there a different way I can trigger this function?

bearing in mind that I can't do onComplete:ShowUsers - as I need a response from the DB before deciding if the function should be called

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month