Connect JS with PHP in laravel blade - development

Connect JS with PHP in laravel blade

I am trying to connect js with php, so:
In one step you can add employment and choose that you work from, to now. And when you click on current (now), then div with toDate dissapears. Now I have to do an edit view where if somebody before clicked on current, that field should be active, not toDate div as is now. How can I achieve this?

      <div id="toDate" class="form-group">
        <label class="col-lg-2 control-label">@lang('main.to')</label>
        <div class="col-lg-6">
          <input type="date" placeholder=" " name="to" value="" class="form-control">
        </div>
      </div>

      <div class="form-group">
        <label class="col-lg-3 control-label"><input id="checkbox1" name="current" type="checkbox" value="current"> @lang('main.current')</label>
      </div>

      <script type="text/javascript">
        $(function () {
          $("#checkbox1").click(function () {
          if ($(this).is(":checked")) {
              $("#toDate").hide();
          } else {
              $("#toDate").show();
          }
            });
        });        
      </script>



from Laravel Questions and Answers https://laravelquestions.com/php/connect-js-with-php-in-laravel-blade/
via Lzo Media

Comments

  1. There are lots of information about latest technology and how to get trained in Hire php developer, like this have spread around the web, but this is a unique one according to me.

    ReplyDelete

Post a Comment

Popular posts from this blog

Using PHP and MySQL data to generate PDF letters like in MS Word mailmerge functionality - development

ng-show doesn’t work correct with value boolean

ng-include of inline SVG does not display gradient except in Chrome