How to make multipule fields editable and uneditable

0
Hi All, I am working with a page where I am using a data views with 50 attributes as textbox, Initially all fields need to be in noneditable format in UI, once I am clicking over that field, only that particular field need to be editable and if I am clicking again over that field that same field need to be noneditable, this functionality need to be implemented for each attributes. Any suggestion for this? Thanks in advance
asked
1 answers
0

Hi Pooja,

You can use following jquery to achieve your task.

 

$('.readonly').click(function(){

    if ( $(this).find('input').is('[readonly]') ) { 
    $(this).find('input').removeAttr('readonly');
    }
    else{
    $(this).find('input').attr('readonly', true);
    }
    
});

Add readonly class name in your text box.

 

Thanks

answered