mercredi 24 octobre 2018

If Session get login in javascript (laravel 5.6)

I got a little problem with Javascript in laravel 5.6. so I have a wizzard setup here, and there are 3 steps. step 1. login or register step 2. another div (hidden) step 3. another div (hidden)

if I still don't have a login session (here I use the session for the login) then I want to go directly to step 2 (hidden div 1 and 2)

and my statement is how do I get login session logic on javascript?

this is the code for the view

       <div class="container">
          <div class="stepwizard1">
              <div class="stepwizard-row1 setup-panel">
                  <div class="stepwizard-step1">
                      <a id="a-step1" href="#step-1" type="button" class="btn btn-primary btn-circle"></a>Step 1</p>
                  </div>
                  <div class="stepwizard-step1">
                      <a id="a-step2" href="#step-2" type="button" class="btn btn-default btn-circle disabled"></a>
                      <p>Step 2</p>
                  </div>
                  <div class="stepwizard-step1">
                      <a id="a-step3" href="#step-3" type="button" class="btn btn-default btn-circle disabled"></a>
                      <p>Step 3</p>
                  </div>
              </div>
          </div>

        <div class="tab-panel setup-content" id="step-1">
          <div class="col-md-12">
              <section class="content">
                <div class="login">
                  <h2>masuk</h2>
                  <div class="alert alert-danger alert-dismissible alert-login" style="display:none;"></div>
                  <form id="form-login">
                  <div id="label_email">
                    <input type="text" placeholder="Email" name="email" id="email"/>
                  </div>
                  <div id="label_password">
                    <input type="password" placeholder="Password" name="password" id="password"/>
                  </div>
                  <button type="submit" class="button nextBtn">Masuk</button>
                  </form>
                </div>
              </section>
            </div>

  <div class="tab-panel setup-content " id="step-2">
    <div class="col-md-12">
        <section class="content">
            <div class="login">
            <h2>Alamat</h2>
            <div class="alert alert-danger alert-dismissible alert-login" style="display:none;"></div>
            <div id="label_email">
                <input type="text" placeholder="alamat" name="alamat" id="alamat"/>
            </div>
            <div id="label_password">
                <input type="text" placeholder="kodepos" name="kodepos" id="kodepos"/>
            </div>
            <button type="submit" class="button nextBtn">Next</button>
            </div>
        </section>
        </div>
    </div>
</div>

btw, here I use ajax for the login form.. Thanks before, and im sorry if it's still wrong because I am still relatively new in the world of programs and my bad...very bad english.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire