[AJAX] arreter l'exécution d'une fonction Ajax
Salut les gars :ccool:,
J'utilise Ajax tags dans des jsp , mon problème est d'effectuer un test avant le lancement de la fonction ajax , mais le truc que j'arrive pas à stoper l'exécution du code Ajax si mon test est faus , je vous donne l'exemple
voilà mon jsp
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
<input type="button" onclick="javascript:setCountrySelection();//nop/" class="searchLink" id="searchLink" value="Search">
<ajax:htmlContent
baseUrl="${pageContext.request.contextPath}/POHtmlcontent.view"
sourceClass="searchLink"
target="searchResult"
preFunction="initProgressSearch"
postFunction="resetProgressSearch"
errorFunction="reportError"
parameters="section=displayResultForPO,brand={brand},product={product},company={company},searchCountryList={countryPricingSelection},pricetype={priceTypeIdList},ertype={ERType},pricestatus={pStatus},erperiod={ERPeriod},currency={submitedCurrency},channel={channel},date={periodDate},records={record},datamode={selectedDatamode},datatype={selectedDatatype}"
/> |
et voilà la fonction js prefunction de la tag ajax :
Code:
1 2 3 4 5 6 7 8 9 10 11
|
function initProgressSearch() {
if(checkMandatoryDate(document.getElementById('periodDate'), true )){
show('globalWaiting');
postCheckedPriceType();
document.getElementById('searchLink').disabled = true;
Element.show('progressMsgSearch');
} else {
return false;
}
} |
J'ai tout essayé mais ça marche pas toujours :(
est ce qu'il y a une idée