*

mwindey

  • *****
  • 470 posts
How to uncheck box in item-post
« on: June 02, 2022, 11:05:09 AM »
In veronika theme it was easy to uncheck the tick box (show phone) on page load in item post with script:
Code: [Select]
<script>   
$(). ready(function() {
//on page load uncheck any ticked checkboxes.
$("input:checkbox:checked"). attr("checked", "");
});
</script>
But that doesn't work in epsilon....Can anyone tell me where to find the hardcoded function to check/uncheck the checkbox?
I thought it was in oc-includes/osclass/item.form.class but that does not seem to be correct :-)
Code: [Select]
  public static function show_phone_checkbox( $item = null ) {
    if($item==null) { $item = osc_item(); }
    if(Session::newInstance()->_getForm('showPhone') != 0) {
      $item['b_show_phone'] = true;
    }
    parent::generic_input_checkbox('showPhone', '1', isset($item['b_show_phone']) ? $item['b_show_phone'] : false );
    return true;
  }
« Last Edit: June 02, 2022, 12:02:12 PM by mwindey »

*

MB Themes

Re: How to uncheck box in item-post
« Reply #1 on: June 02, 2022, 05:11:01 PM »
I would use prop instead of attr and correct selector as well.
You just generally unchecking everything that is checked
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots