Welcome Guest, Not a member yet? Register   Sign In
using xajax in button and textfield
#6

[eluser]sansanwawa[/eluser]
Hi,pandjie

are u using your php with "display_error" = "off"?
Try for my complete code..

controller :
Code:
class Welcome extends Controller {

    var $objRes;

    function Welcome()
    {
         parent::Controller();
         $this->objRes = new xajaxResponse();
         $this->xajax->registerFunction(array ('process_form',& $this,'process_form'));
         $this->xajax->processRequests();
    }
    
    function index()
    {
        $data['Printjavascript'] = $this->xajax->getJavascript("");
        $this->load->view('welcome_message',$data);
    }
    
    function process_form($a)
    {
    
    $result = "Your name is  panji";
    $name =  'txt_value';
    //$name is param of an "id" of an element and its not a "name" of an element
    $this->objRes->addAssign($name, "value", $result);
    return $this->objRes;

    }
    
    
}



View :

Code:
<? echo $Printjavascript;?>

<form name="ajaxform" id="ajaxform" onsubmit="return false;">
          This is your name :
          <input type="text" id="txt_value" name="txt_value" size="20"/>
          <input type="submit" value="submit" onclick="xajax_process_form(xajax.getFormValues('ajaxform'));"/>
  </form>



keep on tryin bro.. Smile



Regards


Messages In This Thread
using xajax in button and textfield - by El Forum - 04-13-2008, 08:28 PM
using xajax in button and textfield - by El Forum - 04-13-2008, 11:38 PM
using xajax in button and textfield - by El Forum - 04-13-2008, 11:52 PM
using xajax in button and textfield - by El Forum - 04-14-2008, 12:09 AM
using xajax in button and textfield - by El Forum - 04-14-2008, 12:36 AM
using xajax in button and textfield - by El Forum - 04-14-2008, 01:35 AM
using xajax in button and textfield - by El Forum - 04-14-2008, 02:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB