deansaddigh Posted May 31, 2010 Share Posted May 31, 2010 I have a enquiry from that is not validating (pop up boxes are meant to come up) Now that i have included this code into my headerlinks.php <script src="js/jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $(".signin").click(function(e) { e.preventDefault(); $("fieldset#signin_menu").toggle(); $(".signin").toggleClass("menu-open"); }); $("fieldset#signin_menu").mouseup(function() { return false }); $(document).mouseup(function(e) { if($(e.target).parent("a.signin").length==0) { $(".signin").removeClass("menu-open"); $("fieldset#signin_menu").hide(); } }); }); </script> This code basically makes a pop out box for my sign in. this can be seen here http://www.languageschoolsuk.com/course_enquiry.php At the top right where it says login. basically makes a box pop out when you click where you can sign in. However you will also notice that on the same page the course enquiry form below will send even with nothing in it, Before i had the above script it used to validate by little pop up boxes comming up. Heres the enqury page code where im using some js <script type="text/javascript" src="js/mootools-1.2.4-core.js"></script> <script type="text/javascript" src="js/mootools-1.2.4.4-more.js"></script> <script type="text/javascript" src="includes/formcheck/lang/en.js"> </script> <script type="text/javascript" src="includes/formcheck/formcheck.js"> </script> <script type="text/javascript"> window.addEvent('domready', function(){ new FormCheck('two'); }); </script> Can you see anyting on headerlink page that stops this form from validating because as i said before it was. Thanks in advance Quote Link to comment Share on other sites More sharing options...
Chezshire Posted May 31, 2010 Share Posted May 31, 2010 Unless you use a function handler to handle the loading of javascripts, I think that you can have only one javascript run at at time (If i'm understanding your problem). If so try adding this to your header, and use it to call your mulitple javascripts (remember to place them in the sequence that you want them to fire off in). <script type="text/javascript"> //place local js code here function init() {//a test function - replace with your cool code! alert("I'm init!"); //pun alert! } //window.onload=init; //run init onload - replace with your function! addOnload(init); //with addOnload() we can add as many functions as we wish to window.onload (one by one)! </script> Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted May 31, 2010 Share Posted May 31, 2010 Mixing mootools and jquery in my book fits in the bad category. I suggest sticking with just one js framework. However if you really must (can't think of any valid reason) there are ways to work around this. Take a look at the noconflict method in jquery and the document.id functionality in mootools. Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted May 31, 2010 Author Share Posted May 31, 2010 Thanks guys, Im new to java script so pardon my ignorance, one question i wanted to ask is do <script type="text/javascript"> $(document).ready(function() { $(".signin").click(function(e) { e.preventDefault(); $("fieldset#signin_menu").toggle(); $(".signin").toggleClass("menu-open"); }); $("fieldset#signin_menu").mouseup(function() { return false }); $(document).mouseup(function(e) { if($(e.target).parent("a.signin").length==0) { $(".signin").removeClass("menu-open"); $("fieldset#signin_menu").hide(); } }); }); </script> have to be in the head of a document Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted May 31, 2010 Author Share Posted May 31, 2010 I fixed it by using the var jq = jQuery.noConflict(); Woop woop, thanks alot guys, for now ill leave it like that, but im gonna do alot more reading up and then use one or the other eg mootoos or jquery Quote Link to comment 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.