stig1 Posted November 17, 2010 Share Posted November 17, 2010 How would i correct this error I receive in firefox error console. Warning: Unexpected token in attribute selector: '!' My coding is the following: <script type="text/javascript" src="app-files/scripts/jquery-1.4.4.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("a[title=submit]").click(function(){ $(this).parents("form").submit(); }); }); </script> HTML Part <a href="#" rel="nofollow" title="submit">Add To Cart</a> Please help, and thankyou in advance! Basically I have created a link which submits a form, because you can style a link better than those input buttons, etc. Quote Link to comment https://forums.phpfreaks.com/topic/219007-jquery-help/ Share on other sites More sharing options...
roopurt18 Posted November 17, 2010 Share Posted November 17, 2010 Are you sure that's the relevant JavaScript? I don't see any exclamation marks in your code. Quote Link to comment https://forums.phpfreaks.com/topic/219007-jquery-help/#findComment-1135797 Share on other sites More sharing options...
stig1 Posted November 17, 2010 Author Share Posted November 17, 2010 Yep, its the only part of javascript i have in the file, apart from the include of the jquery! And i cleared the error console prior to making a post! Quote Link to comment https://forums.phpfreaks.com/topic/219007-jquery-help/#findComment-1135818 Share on other sites More sharing options...
Adam Posted November 18, 2010 Share Posted November 18, 2010 Do you have this online that we could look at, or the full HTML we could run ourselves? It's hard to say why it's giving the error when we can only see a small amount of the actual code. Basically I have created a link which submits a form, because you can style a link better than those input buttons, etc. Really? I find it far easier to style a button. Plus you're making it unusable for those with JS disabled. Quote Link to comment https://forums.phpfreaks.com/topic/219007-jquery-help/#findComment-1136149 Share on other sites More sharing options...
.josh Posted November 19, 2010 Share Posted November 19, 2010 try wrapping submit in quotes: $("a[title='submit']").click(function(){ Quote Link to comment https://forums.phpfreaks.com/topic/219007-jquery-help/#findComment-1136392 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.