SlideDown then call custom function
- by user275074
Hi,
Having difficulty understanding why my function is being called twice.
I'm trying to detect when a radio button is called (intRev_yes), check if a div is empty, slide down another div and then call a custome function which dynamically creates a date field.
if(this.id=="intRev_yes"){
if($('div#mainField').is(':empty')){
$('.intRevSections').slideDown('slow',function(){
current=-1;
addIrField();
});
}
}
When I alert out at each stage, after getting to the end (i.e. addIrField()), the script seems to go back to the slideDown() section and recalls addIrField(). I can't understand why, there are no loops. current is used as an index for the date field.