Mutley Posted October 10, 2006 Share Posted October 10, 2006 This makes no sense to me, I just can't understand it, so I'll try to explain for you to help me.I'm using a javascript color picker. I have a file called form.php which has all the form options in and it has 2 fields where a color picker is used, when you click a link it opens a DIV box under the form displaying the selectable colours. If I have this code:[b]EDIT: For some reason I can't post the code, I get a reconnection error.[/b]In the file with no <html><header><body> tags it works fine.When I add all the common file tags, like a header.php and footer.php the code doesn't work how it should. When I click the link the DIV box opens in the first form field and not under the 2nd when I click the 2nd.I've tried putting the code everywhere and no luck, the only way to fix it is to not have the header.php in use (no html/header/body tags).Any ideas? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 10, 2006 Share Posted October 10, 2006 Obviously, you're producing invalid markup from these PHP files. Quote Link to comment Share on other sites More sharing options...
Mutley Posted October 10, 2006 Author Share Posted October 10, 2006 Can you explain abit more? It isn't obvious to me - obviously. :P Quote Link to comment Share on other sites More sharing options...
Mutley Posted October 11, 2006 Author Share Posted October 11, 2006 Still getting problems, anyone? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 11, 2006 Share Posted October 11, 2006 I'd have to see the code... make sure you properly escape your script blocks when you post. Quote Link to comment Share on other sites More sharing options...
Mutley Posted October 12, 2006 Author Share Posted October 12, 2006 This is it:[code]<S#CRIPT LANGUAGE="Javascript" SRC="ColorPicker2.js"></SCRIPT><S#CRIPT LANGUAGE="JavaScript">var cp = new ColorPicker(); // DIV style// Javascript for colour picker</S#CRIPT>[/code][code] <A HREF="#" onClick="cp.select(document.forms[0].font_content_color,'pick1');return false;" NAME="pick1" ID="pick1">Click here to pick a colour<br /> </A><s#cript language="JavaScript" type="text/javascript">cp.writeDiv()</script> </td>[/code]And it won't work no matter where I have it. Unless I don't include a header/footer. Quote Link to comment Share on other sites More sharing options...
fenway Posted October 12, 2006 Share Posted October 12, 2006 Actually, I was looking for the final HTML output for the page that "doesn't work". Quote Link to comment Share on other sites More sharing options...
Mutley Posted October 12, 2006 Author Share Posted October 12, 2006 I've looked carefully at the source code, it isn't my HTML that is the problem. When I add the Script to the top of my header above the body/header/html tags it works but it cancels all my body/header/tags out because the javascript file is already producing them.It skips my CSS file, but I can't see anywhere in the JS to show where it is producing these tags. I looked at the source when I included the file to see the code and it seems to think the "for" code tags in the JS file are the header/body/html tags, or along those lines.The JS files source and example can be found here:http://www.mattkruse.com/javascript/colorpicker/combined_source.html Quote Link to comment Share on other sites More sharing options...
fenway Posted October 12, 2006 Share Posted October 12, 2006 [quote author=Mutley link=topic=111138.msg451036#msg451036 date=1160675824]I've looked carefully at the source code, it isn't my HTML that is the problem. When I add the Script to the top of my header above the body/header/html tags it works but it cancels all my body/header/tags out because the javascript file is already producing them.[/quote]I have no idea what you mean by "cancels".[quote author=Mutley link=topic=111138.msg451036#msg451036 date=1160675824]It skips my CSS file, but I can't see anywhere in the JS to show where it is producing these tags. I looked at the source when I included the file to see the code and it seems to think the "for" code tags in the JS file are the header/body/html tags, or along those lines.[/quote]Ditto. 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.