Code Bug Fix: how to clone row and create new radio button name (keep every radio button group name unique)

Original Source Link

how to clone new row (the sub element radio button name )

html jinja2 (use for loop from json file item that use python process make)
like

                {% for i in data %}
                    <tr class="tr_clone">
                        <td id="td_id_{{ loop.index }}" scope="row" class="member_data_title td_id">
                            <span class="td_id_span">{{loop.index}}</span>
                        </td>
                        <td id="td_logic_{{ loop.index }}" scope="row" class="member_data_title td_logic">
                            <label for="login_and">AND</label>
                            <input type="radio" id="login_and_{{ loop.index }}" name="logic_{{ loop.index }}" {{'value=1 checked="checked" ' if i['Logic'] == 'AND' else 'value="0"'}}>
                            <label for="logic_not">NOT</label>
                            <input type="radio" id="login_not_{{ loop.index }}" name="logic_{{ loop.index }}" {{'value=1 checked="checked" ' if i['Logic'] == 'NOT' else 'value="0"'}}>
                        </td>
                        <td id="td_StudyDescription_{{ loop.index }}" scope="row" class="member_data_title td_StudyDescription">
                            <input type="text" id="StudyDescription_{{ loop.index }}" name="StudyDescription_{{ loop.index }}" value="{{i["StudyDescription"]}}">
                        </td>
                        <td id="td_SeriesDescription_{{ loop.index }}" scope="row" class="member_data_title td_SeriesDescription">
                            <input type="text" id="SeriesDescription_{{ loop.index }}" name="SeriesDescription_{{ loop.index }}" value="{{i["SeriesDescription"]}}">
                        </td>
                        <td id="td_ImageComments_{{ loop.index }}" scope="row" class="member_data_title td_ImageComments">
                            <input type="text" id="ImageComments_{{ loop.index }}" name="ImageComments_{{ loop.index }}" value="{{i["ImageComments"]}}">
                        </td>

                        <td id="td_btnRuleDelete_{{ loop.index }}" scope="row" class="member_data_title td_btnRuleDelete">
                            <input type="button" id="btnRuleDelete_{{ loop.index }}" name="btnRuleDelete_{{ loop.index }}" value="Delete" class="td_btnRuleDelete_btn">
                        </td>
                    </tr>
                {% endfor %}

script part

 <script>
      $(document).ready(function () {
          $('#btnAddRow').click(function(){
            var $lastRow = $("tr:last"); //grab row before the last row
            var $newRow = $lastRow.clone(); //clone it
            $newRow.find(":text").val(""); //clear out textbox values
            $newRow.find(".td_id_span").text(""); //clear out textbox values
            $newRow.find(".td_btnRuleDelete_btn").remove()
            $newRow.find("radio").attr("name","new")
            $lastRow.after($newRow); //add in the new row at the end
          })

          $('.td_btnRuleDelete_btn').click(function(){
               $(this).closest('tr').remove();
          })
      })
    </script>

hope want add rule new row (raido button part) like

   <tr>
    <td id="td_logic_4" scope="row" class="member_data_title td_logic">
        <label for="login_and">AND</label>
        <input type="radio" id="login_and_4" name="login_and_4" value="" checked>
        <label for="logic_not">NOT</label>
        <input type="radio" id="login_not_4" name="login_not_4" value="">
    </td>
   </tr>

before i click Add Rule
enter image description here
after i click Add Rule
enter image description here

my record id 3 radio button miss name ,then radio check turn to empty

Tagged : / / / /

Code Bug Fix: Selecting a Radio button on Webpage with VBA

Original Source Link

Im working on a project to automate a process which has few radio buttons and need to select a specific one (alternateAddressRadio) all the time.
Following is the HTML and need to know how to get it done.

label class="row" for="alternateAddressRadio">
<input id="alternateAddressRadio" class="js-delivery-address" type="radio" name="chosenAddress" value="alternate" />
Choose a different address</label>

Tagged : /

Code Bug Fix: AngularJS Filter using Radio buttons

Original Source Link

I want to filter Data using Custom filter or default Angular Filter but problem is radio button 1st Click gives data , Next click gives data but includes previous data , I need to uncheck 1st Click and Click next button to get Data.

<div ng-app="myApp" ng-controller="OrderController" ng-init="GetOrders()">
<div ng-repeat="x in List"><input type="radio" name="rdnStatus" ng-model="OrderStatus" ng-click="FilterOrder(status)" /></div>

<Input ng-repeat="x in List" type="text" value="{{x.Product}}-{{x.Amount}}">
</div>

var app = angular.module("myApp",[]);
app.controller("OrderConroller",function($scope,$http){

$scope.GetOrders = function(){
Response.Data - http/GET 
url : ../GetOrders/
};

[{ OrderId : 1 ,
   OrderData : 2020-05-12 ,
   OrderStatus : Accepted ,
   Amount : 1000 ,
   Product : Apple ,
  },
{ OrderId : 2,
   OrderData : 2020-05-12 ,
   OrderStatus : Rejected,
   Amount : 2000 ,
   Product : Apple ,
  },
{ OrderId : 3,
   OrderData : 2020-05-12 ,
   OrderStatus : Accepted ,
   Amount : 3000 ,
   Product : Apple ,
  },
{ OrderId : 4 ,
   OrderData : 2020-05-12 ,
   OrderStatus : Accepted ,
   Amount : 4000 ,
   Product : Apple ,
  },
{ OrderId : 5 ,
   OrderData : 2020-05-12 ,
   OrderStatus : Rejected,
   Amount : 5000 ,
   Product : Apple ,
  },
{ OrderId : 6 ,
   OrderData : 2020-05-12 ,
   OrderStatus : Accepted ,
   Amount : 6000 ,
   Product : Apple ,
  },
{ OrderId : 7 ,
   OrderData : 2020-05-12 ,
   OrderStatus : Accepted ,
   Amount : 7000 ,
   Product : Apple ,
  },
{ OrderId : 8 ,
   OrderData : 2020-05-12 ,
   OrderStatus : Rejected,
   Amount :8000 ,
   Product : Apple ,
  },
{ OrderId : 9,
   OrderData : 2020-05-12 ,
   OrderStatus : Accepted ,
   Amount : 9000 ,
   Product : Apple ,
  },
{ OrderId : 10 ,
   OrderData : 2020-05-12 ,
   OrderStatus : Accepted ,
   Amount : 10000 ,
   Product : Apple ,
  }]

});


I want to filter Data using Custom filter or default Angular Filter but problem is radio button 1st Click gives data , Next click gives data but includes previous data , I need to uncheck 1st Click and Click next button to get Data.

Is there a way i can achieve this functionality .
Please help

As you said you can use default angular filter where you can filter for the property you want,

<div ng-init="FilterValue = 'Rejected'">
  <div ng-repeat="x in data | filter:{OrderStatus:FilterValue}">
      <Input  type="text" value="{{x.Product}}-{{x.Amount}}">
  </div>
</div>

You can find more detailed information about angularjs filters in the documentation

Tagged : / /