0

I am trying to make the date field calendar icon unclickable in some scenarios, which I manage by using this:

$("#ctl00_PlaceHolderMain_EditModePanel1_ctl01_ctl00_DateTimeField_DateTimeFieldDateDatePickerImage").click( function () { return false; } )    

And then in another scenario I want the link to be clickable again, so I tried this

$("#ctl00_PlaceHolderMain_EditModePanel1_ctl01_ctl00_DateTimeField_DateTimeFieldDateDatePickerImage").click( function () { return true; } ) 

Also tried to make it clickable again with a lot of other commands I found on google, but the link stays unclickable.

How can I make a link I made unclickable clickable again ? Please advice

1 Answer 1

0

The cleanest way would be by using the pointer-events css property.

Disable the calendar link:

$("#ctl00_PlaceHolderMain_EditModePanel1_ctl01_ctl00_DateTimeField_DateTimeFieldDateDatePickerImage").parent().css("pointer-events", "none")

Enable the calendar link:

$("#ctl00_PlaceHolderMain_EditModePanel1_ctl01_ctl00_DateTimeField_DateTimeFieldDateDatePickerImage").parent().css("pointer-events", "initial")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.