Jump to content


  • Content Count

  • Joined

  • Last visited

Posts posted by jesh

  1. I tried it and the query fails:mysql_query("SELECT FORMAT(balance, 2) * FROM accounts ORDER BY name ASC");The query works without the FORMAT(balance, 2).
    You have to put commas between the columns that you want returned. This query:
    SELECT FORMAT(balance, 2) * FROM accounts ORDER BY name ASC

    is going to fail just like this would:

    SELECT balance name FROM accounts ORDER BY name ASC

    Try this:

    SELECT FORMAT(balance, 2), * FROM accounts ORDER BY name ASC

  2. Both events are firing, it's just that the mouseover handler is only set up to deal with the mouseover event. The mousemove event isn't going to be doing anything while the mouseover event is being handled because the mouseover event is a snapshot in time. The mousemove event is happening, the mouse goes over the image element, and the mousemove event continues to fire.Here's a brief example (tested only in Firefox):

    <html><head><script type="text/javascript">window.onload = function(){	document.getElementById("image").onmouseover = imgover;	document.onmousemove = mover;}function mover(e){	e = e || window.event;	document.getElementById("output").innerHTML = "(" + e.clientX + " , " + e.clientY + ")";}function imgover(e){	e = e || window.event;	var colors = ["#F00","#0F0","#00F","#FF0","#F0F","#0FF" ];	document.getElementById("image").style.borderColor = colors[Math.floor(Math.random()*colors.length)];}</script></head><body><img id="image" src="http://w3schools.invisionzone.com/style_images/6_logo.png" style="border:8px solid #000;" /><div id="output"></div></body></html>

  3. You could do something like this:

    <html><head><script type="text/javascript">window.onload = function(){	document.getElementById("loading").style.display = "none";	document.getElementById("content").style.display = "";}</script></head><body><div id="loading">This is some content to show while the page is loading.</div><div id="content" style="display:none;">This is the main content of the page</div></body></html>

  4. it seems if the name="login" or id="login" matches the function name it won't work, strange... can't find anything that relates to this problem.
    Also note this - the following will execute the alert:
    <script type="text/javascript">function login(){	alert('GOOOO');}</script><input type="button" name="login" onclick="login();" />

    Whereas this will not:

    <script type="text/javascript">function login(){	alert('GOOOO');}</script><form><input type="button" name="login" onclick="login();" /></form>

    So, as dsonesuk suggests, keep your function names different than your element names and you won't run into this problem again.

  5. That works! Thank you. But could you please explain why only the images with a leading zero in the file name were causing a problem?
    Because you were passing the parameter as a number rather than as a string and the browsers were interpreting the number 0915 as 915.Notice the different outputs of the following two alerts:
    <script type="text/javascript">alert(0915);alert("0915");</script>

  6. If you're talking about ASP.NET rather than classic ASP, then it's really a matter of preference over whether you like PHP or ASP.NET better. If you're talking about classic ASP, run away. Run straight to PHP. :)

  7. The only thing I'd add to both of the examples provided is if the maxLength (or string_length) is variable (e.g. subject to user input) to run a check to make sure that your max length is less than or equal to the length of the chars string. If the chars string was 26 characters long and maxLength was set to 27, you'd get yourself in an infinite loop.

  8. One of your problems is here:

    dgi.Cells(4).Text = "<input type=text />"

    While that will, as you've seen, add a text box to the page in the location that you are expecting, your code-behind cannot have access to that control.If you add a textbox to a web page in the aspx, you do it one of the following ways:

    <input type="text" id="myText" runat="server" /><asp:TextBox id="myText2" runat="server" />

    The key there is that the control has to run at server in order for the code-behind to have access to it.Since you're doing this dynamically, this approach isn't going to work for you. However, if you'd set it up so that those text boxes are already on the page, just styled with "display:none", you can add an onclick to the checkbox to make the boxes visible again. This way, the boxes will be there on the postback and you'll have all the values every time the page posts back to the server.

  9. The only thing that I would add is that regardless of whether you learn client-side first or server-side first, do yourself a favor and become proficient in pure javascript before you take on learning a javascript library such as jQuery.Edit: And I mean really proficient. I worked on web pages over ten years using pure javascript before I started using jQuery.

  • Create New...