Jump to content

Reg Edit

  • Content Count

  • Joined

  • Last visited

Everything posted by Reg Edit

  1. Try:SELECT b1.Location_name as "Location 1", b2.Location_name as "Location 2"FROM location_link as aINNER JOIN location as b1ON a.Location_A = b1.Location_codeINNER JOIN location as b2ON a.Location_B = b2.Location_code
  2. Reg Edit

    xml and <br />

    To prevent the xml parser from interpreting "<", ">" etc in your data, you can enclose the text in a CDATA section:<imgDesc><![CDATA[Courtesy: TSDA <br /> (at Dharmapuri museum).]]></imgDesc> See this page for more info about CDATA sections.
  3. You can use either the class selector or the id selector. There's info and examples here in the tutorial.
  4. It's not like you're going to wake up one day and say, "oh, no, if only I'd read the book instead of using the internet, I would be at a different place today". There's no need to choose one or the other. Both will help you along the same path. Just keep reading day by day, from the sources that work best for you, and every time you learn something, reinforce it with practical work to try out whatever you've just learned.
  5. PHP is an example of server-side scripting. Server-side scripting means that when a web page is requested by a browser, the webserver executes scripts embedded in the page, and then sends the resulting html to the browser. Have a look at the PHP tutorial where it says more about this.
  6. The querystring will be set automatically if you place the textbox and other required fields in an html form. You could then use the link to execute some javascript which submits the form.
  7. From your regular, authoritative xsl posts this could not be in doubt. You certainly don't seem like a beginner to me (even in javascript). In any case, looking back, what you actually said was and I now think by "this" you didn't mean javascript anyway, but just setInterval. (So appropriate, don't you think, in a conversation about javascript, to have a misunderstanding over the value of this! )About the form you want to prevent from being submitted. I don't think I've seen where that actually fits into your code? Would I be right in assuming there's a submit button, which when pressed, shoul
  8. Yes, by checking the value of the tableid field.If it's still not obvious what I mean, please post your union query and I'll use that to show what I mean.
  9. Using onblur for validation is always likely to produce this kind of annoying behaviour. It can outweigh any intended benefit such as "helpfully" setting focus to the errant field. I'd avoid it altogether myself--just do all validation on the form's onsubmit event handler:<html><body><form onSubmit="return onformsubmit()"><input type="text"><input type="submit" value="Submit"></form><script type="text/javascript">function onformsubmit(){// do validation checks here// return true if all valid, otherwise falsereturn false;}</script></body><
  10. I have the feeling you're making it more complicated than it needs to be! By rethinking the approach, you may find you can achieve what you want with a combination of setTimeout/setInterval global variables global functions, passed a reference to the triggering element to give context (if necessary) anonymous functions, passed a reference to the triggering element to give context (as I gave an example of above) But if that's really not enough, then perhaps you're pushing the boundaries of javasript (not bad for a self-titled javascript "beginner"!!) and would do better to consider something ot
  11. The xpath for the top-level messages is:/messages/message So an example of a template to display their ids would be: <xsl:template match="/"> <xsl:for-each select="/messages/message" > <xsl:value-of select="@id"/> </xsl:for-each></xsl:template> If you're getting the lower-level ones too, perhaps you have //message instead of /message?There's a web page here where you can try out xpath queries and see the results.
  12. Have you tried leaving out the redirect? Because according to this, the browser is supposed to do the redirect itself when it gets a 301 response:
  13. (2nd attempt at posting this reply: the first one was itself a victim of the famous Firefox crash!!! )Not obviously OS-related then, as XP SP2 is the one Firefox crashes on for me when browsing these forums.I've switched on the Mozilla Talkback add-on which sends information about crashes back to Mozilla. I've taken to using the Vista box only when composing a reply (forgot this time!), and otherwise using the XP box for all browsing of the forums, so that I can start to send some crash info back to Mozilla (3 or 4 sent already). Hopefully if others do this too we can get the message across a
  14. Yes (with MS SQL at least, and I assume other SQL too): in your select statement, you can just include a new column in the resultset, set to a constant which identifies the table:select 'projects' as tableid, * from projectsunionselect 'news' as tableid, * from news
  15. I understand the problem now: you want a processing loop that pauses between each iteration, but javascript does not have a sleep() function.If you google "javascript sleep" you'll find various things people have done, with varying degrees of success, to implement a "sleep" function in one way or another. Perhaps you'll find one of these useful.
  16. Well, I learned something there--you have an onload function, not referenced in your <body> tag, and FireFox recognizes and executes it! IE does not; it needs <body onload="onbodyload()". Furthermore once this is included, that function name must not then be "onload" because if it is, FireFox then executes it recursively and gets an error!So that'll be why your seeing IE et al doing nothing.As to the AJAX error, you've probably noticed that the first call works, and the second is failing? The line that appears to be upsetting it is:return rep.send(null); With that line commented out,
  17. Well, the referenced stylesheet build.xsl presumably already uses your imgsrc element to emit an <img> html element. So it appears you need to add xml for the other image attributes required, such as:<imgsrc>images/sample.jpg</imgsrc> <imghref>your href for the image</imghref><imgtitle>your title for the image</imgtitle><imgalt>your alt text for the image</imgalt> and update build.xsl to use these too.Post build.xsl if that's not clear and you'd like someone to suggest how to do that.
  18. I'm being deliberately selective for clarity (then and again now). What you're presenting is quite complex, and also a little abstract in that it's not completely obvious what you actually want to achieve by this, just from the example we're using, so I've tried to steer a path between your questions (then and again now) to guess at something that I think will help. Others will respond too, as they see fit. The short answer is, you can't use the startCounting() return value, because setInterval() itself returns immediately, and so startCounting() returns before the event of interest occurs.W
  19. 1) No cross-browser issues that I'm aware of.2) To remove from within the function, you could add 1 to a global variable inside the function, and check its value. Example below.3) To remove from outside the function, same check of global variable. <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>TEST</title></head><body><script>var ID;var num = 0;function ShowMessage(){if (++num > 5){ clearInterval(ID); return;}//alert("Click!");document.getElementById('message').inner
  20. I haven't used PHP but from other server-side scripting I would say your index.html could become a server-side scripted (php?) page, so that within it, you could generate that javascript function with the appropriate default value of that variable:if (!serverPage) { var serverPage = (php to write name of correct page, based on what was submitted)}
  21. Good point--bear in mind that rounding will then kick in, which is probably an extra benefit in this case, but may not always be desirable.
  22. I don't think javascript has any built-in number-formatting functions--you just use the weakly-typed nature of the language and perform string operations on the variable:var i = 0.5;document.write(i + "0"); If your number could be, say, 0.55, then after appending the zero, you can use indexof() to locate the decimal point and substr() to truncate to 2 decimal places.
  23. Reg Edit

    escape for minus

    Not sure about MySQL myself, but in MS SQL you would use square brackets. Give that a try:SELECT * FROM [cd-r48x]
  24. Actually I'm not convinced FF is "right" in this case! What css rules say that the div pairs should line up that way? Perhaps someone will make a better suggestion, but I would place each image/description pair inside a containing div:<div><div class="bossimg">...</div><div class="bossdesc">...</div></div>
  25. Reg Edit


    I pasted your code into a new project, removed the databindings so I could just run it, and it works fine. The textbox becomes visible and invisible according to whether you select 18 in the dropdown.This hacked version is below for you to play with, copied straight from the working project: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">
  • Create New...