Topic: onclick html button, run javascript funtion and After run php xajax

Hi all !

I come back with another (simply?) problem, I've an HTML button. When I submit my button, I run a javascript function who change a global variable A, and place this value in a <div id="result"> via " $('#result').html(A); ".
When my javascript funtion calculate A, i would like compare A with my data base via a php function xajax, how do it ?

After many research, i don't find what I am looking for...
   
Thx for your help !

Re: onclick html button, run javascript funtion and After run php xajax

You can call your xajax function from your javascript function using xajax_myfunction(...)

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

3 (edited by okligek 2012-05-13 7:44:58 AM)

Re: onclick html button, run javascript funtion and After run php xajax

thx for reply smile

I already did find this funtion ( xajax_myfunction...), but i didn't find how use it..

I try this, but nothing happened  :

<?php
include("./php/analyse_reponses_ajax.php");
...
$analyseReponsesAjax =& $xajax->registerFunction('analyseReponsesAjax');
$analyseReponsesAjax->setParameter(0, XAJAX_JS_VALUE, 'test666'); //my mistake is here maybe...i'm not sure with "XAJAX_JS_VALUE" 
...
?>

<html>
     <head>
          ...

in my javascript function : (call from an input button)

function valide_reponses(){
...
     xajax_analyseReponsesAjax(test666); //test666 is a javascript gloval string
     $('#resultat_analyse').html(test666);
}

And here my php 'xajax' function :

<?php
     function analyseReponseAjax($var){
          $objResponse = new xajaxResponse();
          $objResponse->assign('debug', 'innerHTML', $var);
          return $objResponse;
     } 
?>

I'm sorry for all these questions but I don't find example or explanation for 'xajax_funtion' via Google and xajax's docs, tutorials..

edit : I tried replacing this :

$analyseReponsesAjax =& $xajax->registerFunction('analyseReponsesAjax');
$analyseReponsesAjax->setParameter(0, XAJAX_JS_VALUE, 'test666'); //my mistake is here maybe...i'm not sure with 

by

$xajax->registerFunction('analyseReponsesAjax');

but nothing happened again..

Re: onclick html button, run javascript funtion and After run php xajax

I find a (good? xD) solution !

<button id='bouton_analyse_reponses' onclick='analyse_reponses();xajax_analyseReponsesAjax(test666)' >

I call javascript function, and after i call my ajax function tongue simply...

Re: onclick html button, run javascript funtion and After run php xajax

Sorry for the confusion. smile

By xajax_myfunction() I ment that you call your registered xajax function from your javascript function in the browser.

So you can call your registered analyseResponsesAjax() from the analyse_responses function.

Your solution does the same thing.

Ed

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: onclick html button, run javascript funtion and After run php xajax

Next good enhancement we notice here is enabling you to request both SPCascadeDropdowns and SPDisplayRelatedInfo to perform their logic with the use of the item IDs instead of the values of item. We have till now seen SharePoint to use in most of the cases the latter option but former one offers more robustness and database-like approach. Also there are more add-ons that were missed web service operations and most people increasingly were asking for. They are Lists.CreateContentType, Lists.GetListItemChanges, SiteData.GetWeb, SiteData.GetSite, SiteData.GetSiteUrl, Lists.ApplyContentTypeToList, Lists.UpdateContentType and Lists.DeleteContentType. Also you will further see many other performance improvements and some edge condition bugs that the inventor has managed fixing.

Re: onclick html button, run javascript funtion and After run php xajax

Thank you so much... i didnt have the knowledge inthis now i get an idea about this.. thks a lot:-)