Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. Are you sure there is a column in your database entitled "titel"? Or should it be "title"?
  2. jesh

    Form Validation

    Can you use two different forms? One form for the dropdown menu and another form for the rest of the inputs and put one submit button in each form? If you click the submit button in one form, do the inputs from the other form get submitted to the server?EDIT: I looked around a bit - as I'm sure you're already aware, I don't know lick about CF - and came across this link:http://cfdj.sys-con.com/read/42040.htmThe last paragraph on the page reads: If that's the case, maybe you could name your form submit button "Submit" and the page refresh button "Refresh" and use that funky looking <CFIF> tag to see if "Refresh" was clicked. Then, maybe, you could look at the value of your dropdown and reload the page with some new value in the query string (e.g. mypage.cfm?item=4).
  3. jesh

    Whoa...

    4.5x10-10K = .00000000045K
  4. Heh, that must have been it. I played with your code a bit and this seems to have fixed it (I'll display the relevant parts).CSS:#search { background-color:#b16100; float:right; width:149px; height:auto; padding:0px; margin:0px; }#search img { display: block; } HTML: <div id="search"> <img src="/images/search_top.gif" /> <input name="textfield" type="text" size="15" /> <img src="/images/search_advanced.gif" style="float:left;" /> <img src="/images/search_go.gif" style="float:left;" /></div> The images had a bottom margin of about 5px. Don't know why though. Changing the display for the images to "block" got rid of it.
  5. jesh

    Whoa...

    Yeah, I agree: 3 or 4K maybe, but not 0.EDIT: Eeek, I guess MIT got a lot closer: http://www.wikipedia.org/wiki/Absolute_zero
  6. When I load this in Firefox, this is the source I see for the search form: <div id="search"> <img src="/images/search_top.gif" /> <img src="/images/search_advanced.gif"/><img src="/images/search_go.gif"/> </div> When I load this in IE6, this is the source I see: <div id="search"> <img src="/images/search_top.gif" /> <label> <input name="textfield" type="text" size="15" /> </label> <img src="/images/search_advanced.gif"/><img src="/images/search_go.gif"/> </div> Maybe if the source was the same for both browsers, you'd get that same display glitch.
  7. Right, I noticed that too. A blank post.
  8. Using aspnetguy's method of setting and getting the cookie created a cookie on my computer with the following settings: Name: Content: mycookie%3Dsomevalue%26Fri%20Dec%2015%202006%2008%3A29%3A24%20GMT-0800%20Host: Path: /C:/Documents%20and%20Settings/[My Username]/Desktop/Send For: Any type of connectionExpires: at end of session Maybe it's because the Name attribute is blank that we get the "undefined". Also, since the cookie expires at the end of the session, if I were to close my browser the cookie would automatically be deleted. We wouldn't be able to come back at another date to use the Cookie.get method.It might be more relevant to have data like the following: Name: [SomeGlobalCookieName]Content: mycookie=somevalue|mysecondcookie=someothervalue|userid=tlvCIEH64L0dwfxziTxHost: Path: /C:/Documents%20and%20Settings/[My Username]/Desktop/Send For: Any type of connectionExpires: Sunday, January 17, 2038 4:00:00 PM
  9. As Reg Edit explained in this post - http://w3schools.invisionzone.com/index.php?showtopic=9600 - the techonologies do not matter in web services. If your web service were called with http://www.mywebserver.com/myservice.asmx, then you would simply reference that URL in your PHP code to get the XML response from your web service.
  10. If you don't want to use client-side script at all, then justsomeguy has got it with:<script type="text/javascript">var header;function toggleHeader(href){ // this is the DOM object for the header img element header = (header) ? header : document.getElementById("theHeaderImg"); // make sure the link is in "?header=imgpath.jpg" format if( href.indexOf("?header=") > -1 ) { // strip off the "?header=" part var imgPath = href.replace("?header=", ""); // and assign the image path as the src of the img element. header.src = imgPath; // return false to prevent the hyperlink from sending the request. return false; } else { // the link didn't have "?header=" in it, so let's return true and let the link // perform normally return true; }}</script> Then, in your HTML/PHP, you could have the thumbnails look like this: <a href="?header=header1.jpg" onclick="return toggleHeader(this.href);"><img src="header1.jpg" /></a> If javascript is enabled, the visitor doesn't have to reload the entire page to display the new image - s/he just has to wait for the image (unless you pre-cache it). If javascript is not enabled, the onclick event is ignored and the page loads as justsomeguy described.
  11. I typically declare all of my functions in the head - rather, I typically put them in a separate js file and link to them from the head. Then, if I have a function which uses the DOM to affect the body, I wait to execute that function until the onload event fires:<head><script type="text/javascript">function updateDiv(){ document.getElementById("myDiv").innerHTML = new Date();}window.onload = updateDiv;</script></head><body> <div id="myDiv"></div></body>
  12. jesh

    FullText Search

    MySQL ignores words that are 3 letters or smaller by default. This would explain why "man" and "job" are ignored. It also has a list of stop words - words that appear very often in text so to include them would mean returning lots of meaningless results. This explains why "in", "for", and "when" are ignored.This link talks a little bit about that:http://dev.mysql.com/doc/refman/5.0/en/ful...ine-tuning.html
  13. Check out this site, they have a decent tutorial, a good reference, and some decent examples as well:http://www.regular-expressions.info/Here's their page on dates: http://www.regular-expressions.info/dates.html
  14. You can have control fall through the cases too (in Javascript, but not in C# ):var test = 2;switch(test){ case 1: case 2: case 3: // do something; case 4: // do something else; break; case 5: // do something completely different; break; default: break;} I think they are usually declared in the head because the head is parsed by the browser before the body. If you have an element in the body which calls a function, that function will need to have been declared or else you'll get an error. Putting the functions in the head helps prevent this from happening.
  15. Javascript works the same way - the following are equivalent:if(x == "test") alert(x); if(x == "test"){ alert(x);} Like C# (and I assume C++) you only need to use the braces if you have more than one statement in the if. But, like aspnetguy pointed out, you have to use == (equivalancy operator) rather than = (assignment operator).
  16. My PHP is so rusty, there's probably a function built in that does this, but here's what a javascript function would look like: function pad(number){ if(number < 10) { return "0" + number; } else { return number; }}document.write(pad(5)); // writes "05"document.write(pad(12)); // writes "12" EDIT: Hmm, this may be what you are looking for: http://www.php.net/str_pad $input = "5";echo str_pad($input, 2, "0", STR_PAD_LEFT);
  17. After you go through that tutorial, make sure you bookmark this link:http://www.connectionstrings.com/This Google search may help too: http://www.google.com/search?hl=en&q=v...base+connection
  18. Sure you can. pulpfiction is right.var x = 5;document.write(x--); // prints "5"alert(x); // alerts "4" var x = 5;document.write(--x); // prints "4"alert(x); // alerts "4"
  19. random() is what is called (in some programming languages) a static method of the Math class. What this means is that you do not have to instantiate (using the "new" keyword) a new object of type Math in order to use the random() method. To confuse you even further (sorry!), I don't think you can even instantiate a new Math object.I don't think this will ever work:var myMath = new Math(); The math class is a little bit weird in that it is a collection of methods/functions that you can call directly from the class without ever having to instantiate a new Math object: var radius = 4;var area = Math.PI * Math.pow(radius,2); It gets easier, I promise!As for your second question, both of the document writes will function correctly. It's just that the first one will write: <font color="blue">Hello</font> While the second one will write: <font color='blue'>Hello</font> It's a bit uglier, but, because of other programming languages I use, I tend to stick with something like this: document.write("<font color=\"blue\">Hello</font>");
  20. jesh

    how to make a forum

    Don't forget a table for the users. And the user types (i.e Moderator, Admin, Poster, etc.).
  21. Since this is .NET, you might consider playing around with the browserCaps setting in the Web.Config file.This Google search may help: http://www.google.com/search?hl=en&q=b...s+W3C_Validator
  22. Ok, I know with regular expressions, I can replace all instances of a string within another string like this: var string = "http://www.microsoft.com is the best site out there! Don't you just love Microsoft?";var newstring = string.replace(/microsoft/gi, "W3Schools");document.write(newstring); That works great. Everywhere (case-insensitive, btw) where you see "microsoft", "W3Schools" now appears. My question is, what if the string that I want to replace is a variable? var replaceWord = "microsoft";var string = "http://www.microsoft.com is the best site out there! Don't you just love Microsoft?";// how can I use string.replace() here to replace all instances// of whatever the value is of replaceWord? EDIT:========================================Ah...Google to the rescue again. doh!Searching Google for "variables in regular expressions" returned this:http://www.webreference.com/js/column5/methods.htmlThis code works for me: var replaceWord = "microsoft";var string = "http://www.microsoft.com is the best site out there! Don't you just love Microsoft?";var regex = new RegExp(replaceWord, "gi");var newstring = string.replace(regex, "W3Schools");document.write(newstring); I tried Google first, but it wasn't until I wrote this post that I was able to word my searching correctly. I answered it myself, go figure! Maybe the post will help someone else at least. heh.
  23. I don't know about Word, but you can fairly easily dynamically generate XML so that it can be viewed as an Excel spreadsheet. This is good for a site which needs to generate reports in spreadsheet format - rather than relying on some Excel API and VB.
  24. Nice link! I was just about to ask in a different post "Can you use strings as the keys/indices in arrays in javascript?" and this answers my question perfectly with "NO!". Yeah, I've never used the for in loops until recently. When I was first learning C#, I looked for a foreach equivalent in javascript but didn't find one so I stuck with the typical for loop. When I came across the for in loop, I figured that was my answer. But, like you, I'll just go back to sticking with the typical for loops from now on.
×
×
  • Create New...