The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Forced to edit link instead of going to link in editable table cell
post Jan 12 2019, 03:50 AM
Post #1

Group: Members
Posts: 1
Joined: 12-January 19
Member No.: 26,794

I have the following code which allows me to edit a cell, but the problem is that when I want to click on the link, it forces me to edit instead. I want to be able to edit only when I click on the pen icon, but I can't seem to figure out how to do it.



<link href="" rel="stylesheet">

<table border="1" style="width:100px" style="height:99px" style="margin:0
<td ><div class="row_data" edit_type="click" col_name="datamapname"><i
class="fa fa-pencil"></i><a id="dm" href=""




    $(document).on('click', '.row_data', function(event)
    //Remove pencil icon.

    //Remove link

    if($(this).attr('edit_type') == 'button')
        return false;
    //make div editable
    $(this).closest('div').attr('contenteditable', 'true');
    //add bg css
    $(this).attr('original_entry', $(this).html());
    //--->make div editable > end

  // --> save single field data > start
    $(document).on('focusout', '.row_data', function(event)

        if($(this).attr('edit_type') == 'button')
            return false;

    //Add pencil icon back
        $(this).append('<i class="fa fa-pencil"></i>');

    //Add link back


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


- Lo-Fi Version Time is now: 19th October 2019 - 08:33 AM