Hello Folks,
I have a script which does ajax call on onclick event, attached is a block of snippet used to process all the records available on the page, all it does is on ajax call is to converts tick image to cross image or cross to tick image.
Currently the script converts all tick to cross and if they are already any cross image(s) it is converting them to tick.
The change I want is instead of changing all (croos and tick) images on the page, it should only tick the images which are crossed and ignore all those images which are ticked.
This problem probably because I am calling one function from the tick and cross images?
Hielo, you probably be the best person to assist me on this as you already have seen the code earlier.
Thanks for any help guys.
Regards
Sam
function processAll() { //obtain list of <span class="id"> var theIds = $("span.id"); for(var i=0; i < theIds.length; ++i) { var theImage = theIds[i].getElementsByTagName("img")[0]; var theId = theImage.className.replace("id_",""); //var theValue = ( (theImage.src.indexOf("avail_yes") > -1) ? "Y":"N"); var theValue = ( (theImage.src.indexOf("avail_yes") > -1) ? "N":"Y"); // ajax call makeAjaxRequest(theId, theValue); } }
if ('Y' == theValue) {
makeAjaxRequest(theId, theValue);
}
maybe?