Link to home
Start Free TrialLog in
Avatar of Sathish David  Kumar N
Sathish David Kumar NFlag for India

asked on

how to call Jquery function inside the JS function

Hi ,
	// Avoiding duplicate Head value 

	jQuery(function($) {
	alert("1234");
    var backups = {};
    $("select[id^=headNo]").change(function() {
        var v = $(this).val();
        alert(v);
        var f = false;
        $("select[id^=headNo]").not(this).each(function() {
        alert("456");
        alert($(this).val());
            if($(this).val() == v) {
                f = true;
                return;                
            }
        });
        if(f) {
            $(this).val(backups[$(this).attr("id")]);
            alert("Duplicated Head Value!");
        }
        else {
            backups[$(this).attr("id")] = v;
        }
    }).val(null);
});

Open in new window


I have code like this in JS file . I Want to call this code from JS function how to call ?
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial