Jump to content

ShadowMage

Members
  • Posts

    3,476
  • Joined

  • Last visited

Posts posted by ShadowMage

  1. I'm guessing you're seeing the main/footer links get styled when they're visited or active. This is because your selectors are just a little bit off. They should look like this: #header a:link, #header a:visited...#header a:hover, #header a:active... You need to include the #header selector every time. Think of the comma as separating a list of selectors. When you write:#header a:link, a:visitedyou are actually telling it to select all a:link elements within #header and all a:visited elements on the page.

  2. To get around the problem with Ingolme's code (ie, not using spaces) you could create an array map that maps each id to a default value:

    //Map the id's with their default valuesvar defValues = {  'idA': 'Default A',  'idB': 'Default B',  'idC': 'Default C'}// Onfocus handler:function clearField(e) {  e = e ? e : window.event;  var el = e.target ? e.target : e.srcElement;  if(el.value == defValues[el.id]) {    el.value = "";  }}// Onblur handler:function defaultText(e) {  e = e ? e : window.event;  var el = e.target ? e.target : e.srcElement;  if(el.value == "") {    el.value = defValues[el.id];  }}

  3. Define real money?
    elkingrey has a point. "Real money" is only something that others view as valuable. Stones and clamshells have been used in the past (and perhaps still are in some cultures) as "real money". If you could convince someone that neatly printed bits of paper were valuable.....oh, wait...those already are valuable. :P
  4. Thx ShadowMage, I also think cutting up the images is the best solution in my particular case.
    I never said it was the best solution. Personally, I think it's a poor solution. But if you want old browsers to have rounded corners, it's the only solution.
    Any ideas ? Thx
    Not without code or a link.
  5. That depends on what sort of browser support you're looking for. Modern browsers support the border-radius property. If you add the vendor prefixes (-moz, -o, -webkit) you can go back quite a ways before it stops working. The browser with the least support is IE, as versions 8 and down do not support any form of border-radius. Browsers that don't support it will just use square corners. Otherwise if you want maximum compatibility, you'll have to use the images as you mention.

  6. Just put a min-width on the form. 330px seemed to work well for me. Then the form will never get smaller than 330px.

    ps sorry about the formatting of my html code, aren't the
     tags supposed to indent it?.Only if you already have it indented.  They preserve your formatting, they don't format it for you.
  7. Just let the page build itself. HTML has a natural flow that the elements will follow. In general, elements fill the page top to bottom, left to right. An element's display type will affect how it fills in the page. This page and this page should give you a pretty good idea of how the display types behave.Once you understand how elements are placed and how the different display types behave, you can adjust margins and the display type to move elements around. Float is another, slightly more advanced, technique used to place elements. It takes elements out of the natural flow, but they do stay in the flow because they affect the position of elements around them. Absolute and fixed positioning completely remove elements from the flow and should be reserved for special cases where this is necessary.

  8. Well, you're using absolute positioning so it isn't going to be easy if even possible without using JavaScript. My recommendation is to ditch the absolute positioning and use standard positioning techniques like margins, float and display. Then you can apply a margin-top of 50px to the footer and it will keep everything 50px above it.

  9. You really shouldn't need a word so long that it gets outside the box. The best suggestion would be to use proper words and you won't need to change anything.
    While that may be true, a developer should never think that way. You shouldn't think only about what a user is supposed to enter, but also what the user could enter. This is why data to be used in a query is sanitized and why input fields are validated. Just because a user shouldn't enter something, doesn't mean they can't. Invalid or improper data needs to be handled. EDIT: This is, of course, assuming that the text that OP is trying to wrap is user entered data. If it isn't, then yes, using proper words would be the best suggestion. Even still, OP may have a valid reason for needing a "word" that long, though 655px in length is unlikely.
  10. You can set the overflow to hidden and it will just hide the text that extends beyond the border. The only other solution would be to use the word-wrap property and set it to break-word:

    word-wrap: break-word;

    but I'm not sure if older browsers will support it since it's CSS 3. IE 8 supports it, so I would imagine that support in other browsers is pretty good. The only question is whether IE 7 and down support it.

    • Like 1
  11. There still isn't any PHP code. We need to see the code in the file located here: http://www.yourfutur...re/register.phpThat's the file that processes the form submission (notice that's the location specified in the action attribute of your form) and should be the file that inserts the data into your database and redirects the user. EDIT:Is it possible to post a URL without it turning into a link?

  12. I know what siblings are. Have you verified that what dsonesuk said is true? I think dsonesuk's statements in post 9 are either misleading or inaccurate. Siblings must have the same parent. In your example, the elements #num11, #num12, and #num13 have a different parent element than the elements #num21, #num22, and #num23 so they are not siblings of each other. Thus, retrieving the siblings for #num11 should return only #num12 and #num13 because #num21, 22, and 23 are not siblings of #num11.

    • Like 1
  13. I can't believe nobody's mentioned escaping data. You are using the POST variables directly in the query, which is a very bad idea. Google "SQL injection" if you want to see why it's a bad idea. You should be using mysql_real_escape_string to escape those values before using them in your query.

  14. Have you checked to see which elements are returned if you do $('#num11).siblings()?It should return only #num12 and #num13. #num21, 22, 23 are not siblings of #num11 because they have a different parent.

  15. SSDs seem to work well for system drives. My Windows 7 installation on my home computer is installed on a SSD and it is much faster than any installation I've worked with on a HDD.

  16. Once again, the HTML does not matter. Its the PHP code that's causing the problems (ie, the code in register.php). If you don't know what PHP is, start with the tutorial. I'm not walking you through this one because it's a little more...involved...than putting a border on a form... Oh, and to validate your code you can use the W3C validator:http://validator.w3.org/

  17. Not the parent, but the closest ancestor that has a set height.
    The closest ancestor with a set height would still be the container, not window...
    At the moment the problem is that #column3 element doesn't seem to have a height assigned anywhere.
    Right. That's the element we're trying to adjust the height of. If the height of column3 is set to 100%, it should be the same height as the #container div, but it isn't. In fact, after looking at it again, just now, it doesn't even match the height of the body, html, or window... I just took another look at it and in fact the height is the same as #container. The padding is what makes it look like it is much larger. Height simply defines the height of the content area of an element, not it's overall height. AFAIK, there is no good fix that will allow the use of relative sizes. At least not for older browsers. The box-sizing property can fix it for newer browsers.
  18. If you set the height to 100% it will be exactly as tall as the window.
    That seems to be what's happening but isn't it supposed to be 100% of the parent's height? The window is not the parent of column3. The container div is, which happens to use 100% height (correctly this time) to make it the same height as the body, which is 90% of the html, which is 100% of the window.
  19. There's nothing wrong with submitting the form to itself. You can put a conditional in your code to see if data was submitted. If it has process it, otherwise show the form. The real question is what do you intend to do with the data once you submit it? Are you storing it in a database or file? Are you sending an email to the user? What is your purpose?

  20. I'm not really sure what your problem is. Can you explain a little more or post a link to an online example? As for the function, though, you can condense and generalize that considerably. For starters, you can get rid of id1, id2, id3, etc. and just use the arguments property of the function. Then use a loop, to set the display of the elements.

    function displayForm(obj) {  txt = obj.options[obj.selectedIndex].value;  var disp = 'none';  for (var i=1, n=arguments.length; i<n; i++) {    if (txt.match(arguments[i]) {	  disp = 'block';    } else {	  disp = 'none';    }    document.getElementById(arguments[i]).style.display = disp;  }}

    With this code, you'll be able to add more select options and forms to display without having to modify your function. The arguments property of a function provides access to all arguments passed to the function without having to explicitly list them in the parameter list. All you do is add the new id to your function call and the function will accommodate it. Also notice that I changed the name of your function. I did this to avoid collision with the display property of the style object. It shouldn't actually cause a collision because of the scope (that's an advanced topic so don't worry about it right now), but it's good practice to avoid naming variables and functions with any built-in property or function name.

  21. Well, I'm perplexed...if I set the height of the column3 div to 100% it sets it to 100% of something but certainly not its parent.... I honestly don't know why because all of its ancestors have a height specified. Problems like that usually occur when the body and/or html do not have a specified height, but that isn't the case here. Anyway, when the height issue gets figured out, you can just add overflow: auto to the column3 div and it should give you a scrollbar when necessary.

×
×
  • Create New...