Jump to content

Why won't my JQuery input mask work :(

Brawhammer

Hey all,

 

So at the moment I have a box, When you press that box http:// will appear at the start then you can put in you url, You get the drift.

 

This was fully working till I decided to get a template and implement bootstrap. Now it does not work.

 

My Custom.js

 

$(function() {$('#website').inputmask();});

My check.blade.php

 

@[member=include02]('templates.header')        @[member=include02]('templates.nav')<section        @if (Session::has('errors'))            <div class="alert alert-danger alert-dismissible" role="alert">                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>                <strong>Oops!</strong> Better check yourself before you rek yourself.            </div>        @endif        {{ Form::open(['url' => 'checked', 'method' => 'post', 'class' => 'form-inline']) }}            <div class="row text-center">                <div class="col-lg-12">                    <div class="input-group">                        <input id="website" type="text" name="website" data-inputmask="'alias': 'url'" class="form-control input-lg" placeholder="www.yahoo.com" />                        <span class="input-group-btn">                            <button type="submit" class="btn btn-primary btn-lg"><i class="fa fa-check"></i> Go!</button>                        </span>                    </div>                </div>            </div>                        </div>        </div>        {{ Form::close() }}        @[member=include02]('templates.footer')

 

Will appreciate any help here!

 

The footer holds all the js scripts.

 

<!-- js -->{{ HTML::script('js/jquery.min.js') }}{{ HTML::script('js/bootstrap.min.js') }}{{ HTML::script('js/jquery.inputmask.min.js') }}{{ HTML::script('plugins/modernizr.js') }}{{ HTML::script('plugins/isotope/isotope.pkgd.min.js') }}{{ HTML::script('plugins/jquery.backstretch.min.js') }}{{ HTML::script('plugins/jquery.appear.js') }}{{ HTML::script('js/template.js') }}{{ HTML::script('js/custom.js') }}</body></html>

 

I am using Laravel Framework with this.

 

Any help would be great!

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

because it went on vacation. Sorry pointless comment but a very true one also xD

Current Build : 

 
CASE: Fractal Design R4 w/Window CPU: Intel 4930K,  RAM: 16GB Ripjaws Z 2133Mhz  Cooling: H100i  MotherBoard: Asus P9x79 Pro , PSU: CS750M   Storage: 2x Samsung 840 Pro 256Gb , 1Tb Seagate Barracuda, 500GB WD Black,  Graphics: Gigabyte GTX 780 Windforce 3GB,  Monitors: AOC G2460PG ( G sync monitor), Edge10 24" 1080p , 24" 1680*1020p monitor ( LCD)  Microphone: Blue Yeti  Keyboard: Cougar 700k  Phone: Samsung Note 3  Headphones: Sennheiser HD598

Laptop:

 CPU: 
4710MQ  Ram: 8GB 1600MHz Storage:120Gb 840 Evo + 1Tb 5400Rpm HDD  Graphics: GTX 850M 2GB   Screen: 1080p IPS  
Link to comment
Share on other sites

Link to post
Share on other sites

There could be many reasons, so please use Firebug / the Dev Console (F12) and check the Tab labeld "Console" for error messages and warnings. Once you paste them here it'll be much easier to help.

Link to comment
Share on other sites

Link to post
Share on other sites

Learn to problem solve.

 

What changed when you got the template? What could realistically have an effect? Are error messages triggered that could give you a hint to what is broken? What happens when you step through the JS with a debugger? Does it work again if you check out a previous commit (because of course you are using version control)? Are there any errors in the apache error log? What if you remove all JS but the code needed to run this feature? And then progressively add the other scripts back to the template? Is the relevant html showing up for the javascript to hook into? Do you know how and why to use a framework or is your "site" just going to be another depressing mess of PHP?

Link to comment
Share on other sites

Link to post
Share on other sites

You cant call jQuery before you call jQuery file, simple as that.

1st include jQuery lib then call:

$(document).ready(function() {   console.log("Whatever you want.");});

And yeha learn to use dev console or firebug. :)

It helps a lot when you code somthing in JS.

Link to comment
Share on other sites

Link to post
Share on other sites

because it went on vacation. Sorry pointless comment but a very true one also xD

 

 

There could be many reasons, so please use Firebug / the Dev Console (F12) and check the Tab labeld "Console" for error messages and warnings. Once you paste them here it'll be much easier to help.

 

 

Learn to problem solve.

 

What changed when you got the template? What could realistically have an effect? Are error messages triggered that could give you a hint to what is broken? What happens when you step through the JS with a debugger? Does it work again if you check out a previous commit (because of course you are using version control)? Are there any errors in the apache error log? What if you remove all JS but the code needed to run this feature? And then progressively add the other scripts back to the template? Is the relevant html showing up for the javascript to hook into? Do you know how and why to use a framework or is your "site" just going to be another depressing mess of PHP?

 

 

You cant call jQuery before you call jQuery file, simple as that.

1st include jQuery lib then call:

$(document).ready(function() {   console.log("Whatever you want.");});

And yeha learn to use dev console or firebug. :)

It helps a lot when you code somthing in JS.

 

YES!

 

I got it. Turns out I didn't have the bloody plugin being mounted right. Gah!

 

Works now though thanks all of you! :)

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

I was thinking this could be the issue.

<section

i want to die

Link to comment
Share on other sites

Link to post
Share on other sites

 

I was thinking this could be the issue.

<section

 

He already told what's the issue but did marked question as answered.

Link to comment
Share on other sites

Link to post
Share on other sites

He already told what's the issue but did marked question as answered.

I noticed, I was saying at first look I figured his html was going to be broken because he messed up the section tag.

i want to die

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×