How to disable hyperlink after some numeric digit

Hi Team,


As part of my development I have created one hyperlink and after specific clicks (e.g. 5) that hyperlink should be disabled. Could you please help me on this? Thanks.


Thanks.

Naveenkumar A.

Hello Naveenkumar,

You need to keep the counting of how many times the user clicked and use a condition in the Enable property (probably) that will disable the link in case the counting is higher than your threshold.

In what part are you having problem?

Cheers.

Hi Eduardo Jauch,


Can you give me one example on how to set the limit/count condition on Enable property. 

Presently i am using below  in Enable property, please add disable property to it based on the count.


(MRIPropertySetupForm.Record.id = NullIdentifier() or
MRIPropertySetupForm.Record.request_statusID = Session.Draft or
MRIPropertySetupForm.Record.request_statusID = Session.SupportAmended) and
IsCurrentUserEmail(MRIPropertySetupForm.Record.requestorId)


Thanks.

Naveenkumar Akula.

Hi, 

Can't give an example.
But you know how to use the Enable property, as you are using it.

You only need to add an AND to those conditions comparing the actual number of clicks with your threshold (must be < or <=). 

You will have to store them in database, if the counting must persist through sessions, or in a session variable if the counting is per session.

Cheers.

Hi Naveenkumar Akula,

Try making use of jquery . Something like this.

SyntaxEditor Code Snippet

$(document).ready(function(){
var count=0;
$('.MyLink').click(function() {    
    count=count+1;
    
    if(count>5){         
     $(this).removeAttr('onclick');
     return false;
   }    
});

});

Find the sample oml in the attachments.

Regards


Hi Pranav,


Sorry to ask you, can you kindly send me Sample oml in Version 10 because I am using Version 10 in my system.

Thanks.


Hello Pranav and Naveenkumar,

I STRONGLY advise against using JavaScript for this type of feature if this is a security requirement, as being in the HTML it is very easy for a user to change it and disable this code.

Cheers.

Naveenkumar Akula wrote:

Hi Pranav,


Sorry to ask you, can you kindly send me Sample oml in Version 10 because I am using Version 10 in my system.

Thanks.


Sorry I cannot as my personal environment is been updated to version 11. You can just copy the  jquery function on your page jquery section and add the class 'MyLink' to your link style section. Please find the screen shot in the attachment. 

Eduardo Jauch wrote:

Hello Pranav and Naveenkumar,

I STRONGLY advise against using JavaScript for this type of feature if this is a security requirement, as being in the HTML it is very easy for a user to change it and disable this code.

Cheers.

Agreed .

Hi Naveenkumar Akula,

As Eduardo Jauch suggested its better not to use jquery . So you can just store the count in a entity (with user id , Form id etc as per your requirement.). Its easy and simple .Find the sample oml in the attachments.


Pranav Pandey wrote:

Hi Naveenkumar Akula,

As Eduardo Jauch suggested its better not to use jquery . So you can just store the count in a entity (with user id , Form id etc as per your requirement.). Its easy and simple .Find the sample oml in the attachments.


If you not able to view the oml , then refer to the attached document. I hope it will be helpful.


Thanks Pranav.

Appreciated your help and my problem resolved. Thank you so much.