Click here to Skip to main content
15,922,007 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have javascript function which working fine in all browser accept [Mozill Firefox]
work hard on it but not get any eligible result

main problem In

if (event.srcElement.getAttribute("ISDate") == "")

the main problem is to find [ISDate] from getattribute

looking for ur help

C#
function Calendar_DateClick(event, DateId, SelectedColor, SelectedFontColor, DateBGColor, DateFontColor, AMColor, AMFontColor, PMColor, PMFontColor, UnAvailableColor, UnAvailableFontColor) {

    if (event.srcElement.getAttribute("ISDate") == "")
        return
    var i
    switch (event.srcElement.getAttribute("ISDate")) {
        case "D":
            {
                if (typeof (objPrevDateTD) == 'object') {
                    objPrevDateTD.style.backgroundColor = DateBGColor
                    objPrevDateTD.style.color = DateFontColor
                }

                event.srcElement.style.backgroundColor = SelectedColor;
                event.srcElement.style.color = SelectedFontColor;
                objPrevDateTD = event.srcElement
                if (event.srcElement.getAttribute("AM") == "true") {
                }
                $('#myModal').modal();
                break;

            }

    }
}




thanks
Posted
Updated 8-Jul-13 0:57am
v2

1 solution

C#
srcElement is only available in IE. In all other browsers it is target:

var target = event.target || event.srcElement;

if(target.onclick == null) { // shorter than getAttribute('onclick')
    //...
    document.mainForm.submit();
}
 
Share this answer
 
Comments
Jimmy Darji 8-Jul-13 7:12am    
i'll tried it... its not working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900