Saturday, April 7, 2018

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

1 comment:

  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