paulmo Posted January 25, 2009 Share Posted January 25, 2009 have tried calling id="dtField" in html page; it's just showing id="dtField" in browser. please show me how to call/echo/write the element in the html page. thanks window.onsubmit = initDate; function initDate() { var now = new Date(); var dtString; if (now.getHours() < 5) { dtString = "Good evening."; } else if (now.getHours() < 9) { dtString = "Good Morning."; } else if (now.getHours() < 17) { dtString = "Time to work."; } else { dtString = "Good Evening."; } document.getElementById("dtField").innerHTML = dtString; } Quote Link to comment Share on other sites More sharing options...
webster08 Posted January 25, 2009 Share Posted January 25, 2009 are you wanting to know how to write the <div> element? if so; you would do it something like this (so it will work with your code): <div id="dtField"></div> Quote Link to comment Share on other sites More sharing options...
paulmo Posted January 25, 2009 Author Share Posted January 25, 2009 this still isn't working; i've tried lots of variations. i need to keep the div id=col2 css: <div id="col2"> <div style="background-color:#FFFFFF; padding:10px" class="rounded {10px}"> <div id="dtField"></div> Quote Link to comment Share on other sites More sharing options...
webster08 Posted January 25, 2009 Share Posted January 25, 2009 if you change the innerHTML of the "dtField" div; that is all that will be changed. this would not effect the "col2" div or any content within it. if you are having a problem; i would say this would be it: class="rounded {10px}" that is not the way you create a class. you should not have any spacing or characters other then letters and numbers. Quote Link to comment Share on other sites More sharing options...
paulmo Posted January 25, 2009 Author Share Posted January 25, 2009 ok, i took out spaces; script still doesn't execute. the rounded corners class is working fine; it's a jquery script. here's the latest; getting mysql_fetch_array(): supplied argument is not a valid MySQL result resource also tried assoc...i'm sure more than that is a problem here: $process = mysql_query("SELECT * FROM xxx WHERE MATCH terms AGAINST '%$message%'"); //this is user input which could be any string! $process_results = mysql_query($process); while ($row = mysql_fetch_array ($process_results)) { echo $process_results['terms']; echo " "; } Quote Link to comment Share on other sites More sharing options...
webster08 Posted January 26, 2009 Share Posted January 26, 2009 as i said before the class needs to only have numbers and letters in it; if the brackets is still in there; you will have problems. if this is a jQuery problem; consult there documentation. if this is a php issue; then this thread belongs in the php forum. what exactly are you trying to accomplish, anyway? Quote Link to comment Share on other sites More sharing options...
paulmo Posted January 26, 2009 Author Share Posted January 26, 2009 i will explore that bracket situation with jquery rounded corners; i used the documentation. i just want to echo that id=dtField...took out all other js on page, followed example from book. sent e-mail to authors so maybe they'll write back. 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.