tags:

views:

15

answers:

0

I am searching for help on how to properly refresh all code on a webpage on submit. Below is a little overview of what I'm trying to do, does it make sense ?

PHP

<code>
<?php
if($_POST['submitted']) {
    setting php variables to pass to yui here
}
?>

JavaScript

<script>
YAHOO.util.Event.onDOMReady(function () {
    yui datatable and menubutton code goes here....
}
</script>

Form with menu button that is type post

So, I have the yui menu button. I have a yui listener that calls the following code:

var oMenuButton1 = new YAHOO.widget.Button("menubutton1", {type:"menu", menu: "customerSelect"});
oMenuButton1.getMenu().subscribe("render", onMenuRender);
var onExampleSubmit = function(p_oEvent) {
    if(!bSubmit) {
        YAHOO.util.Event.preventDefault(p_oEvent);
    }
};

YAHOO.util.Event.on("button-example-form", "submit", onExampleSubmit);

When I click the menu button, the php-generated code gets updated fine, but not the yui datatables and other yui elements. What is the correct way to reload all of this content onSubmit ?