Jump to content

stefan1294

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by stefan1294

  1. 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.
    Unfortunately I am not known with your method. Do you know any tutorial about this technique, or could you give me an explanation of how to position borders on your way?
  2. Again, I have a question where I couldn't find the answer of. I think the title explains itself. How will I be able to keep those two borders 50px away from eachother, as my border (#border) increases it's height when needed, automatically. Here is the soruce. The footer has to be ~50px away from the border :)

     #border{font-family: Maiandra GD;top: 500px;left: 390px;width:655px;word-wrap: break-word;min-height: 20px;overflow: visible;padding: 10px;border-radius: 15px;border-style: solid;border-width: 1px;border-color: #D0D0D0;position:absolute;margin:-50px auto auto -100px; } #footer{font-family: Maiandra GD;top: 700px;left: 390px;width:675px;height:20px;border-radius: 15px;border-style: solid;border-width: 1px;border-color: #D0D0D0;position:absolute;margin:-50px auto auto -100px;}

  3. Ingolme and ShadowMage both got a point. I'm entering loads of text in that border, and I cannot be arsed to refresh my page (yes, I am writing my whole website from scratch, in Notepad++) every line I type. I'm using the same border for ~12 other pages. It indeed is not necessarily for me to use the word-wrap prop, as I am not using it for 'user data'. However, for the moment it saves me a lot of time.

  4. 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.

    Thank you. I am working on a project, which will not be released in the public, so I'll justu se the word-wrap prop :)
  5. Hey, I'm working on a webiste with a border. I have placed the border in a div. I managed to make the border height (div height) to adjust on the amount of text lines in the div. However, I can't make it work for the width of the border. How will I be able to do this?My current script:

    #border{font-family: Maiandra GD;top: 500px;left: 390px;width:655px;<-- It may not pass this widthmin-height: 20px;overflow: visible;padding: 10px;border-radius: 15px;border-style: solid;border-width: 1px;border-color: #D0D0D0;position:absolute;margin:-50px auto auto -100px; }

     <div id="border">Hai<br/>haihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihaihai</div>

    I want the haihai spam, to be seperated to more lines so it simply won't exceed the width of the border.

  6. I am not sure what you are talking about, but it's actually working perfectly.

    var postalcodes = /(AA|AB|AC|AE|AH|AK|AL|AM|AN|AP|AR|AS|AT|AV|AW|AX|AZ|BA|BB|BC|BD|BJ)/g;      if(!a.match(postalcodes))    { alert("Not correct!"); return false;    }

    I entered: 7732 CA, it said "Not correct!"I entered 7732 BB and it didn't say anything

  7. OK, have you checked that a exists?
    alert(a);

    Yep, works fine Edit: I just did this to see what the result would be:
    alert(a.search(postalcodes));

    I entered "7856 AA" as postal code, and it alerted "0". I am not sure what to do with it though. It's supposed to say 6

  8. If you're using Firefox, press Control+Shift+J to open the error console.
    I am using Google Chrome. But for so far I can see, it's the same as in Firefox. And, it doesn't give me an error at all.
    Is this code in a function? You'll need to execute the code after the postal code has been written using an event handler.
    Yeah, the code is in a function.
     function validateForm()

    For so far I know, it is being excecuted after the person pressed "Submit":

    <form name="form" action="http://google.com" onsubmit="return validateForm()" method="post">

    <input type="submit" value="Submit">

  9. Be sure to check the error console.
    I am not sure where I can find that :o
    And it would help if you post your updated code here.
    var postalcodes = /(AA||AB||AC||AE||AH||AK||AL||AM||AN||AP||AR||AS||AT||AV||AW||AX||AZ||BA||BB||BC)/g;var a=document.forms["form"]["postcode"].value;  if(a.search(postalcodes))  {alert("Correct!");return false;  }   --<tr><td>Postcode:</td><td><input type="text" name="postcode"></td></tr>

    Nothing happens when I enter a postalcode (e.g. 7321AA or 7321 AA) Edit: At the moment it's saying "Correct" all the time, what ever I put in the text box/label

  10. Hello, I am pretty new to JavaScript, but I am working on a project. Currently I have to find a way to determ if a postalcode is an correct postal code. (A dutch postal code) For that I will have to confirm if two correct letters are entered in the form.I think my explanation is really unclear, so I will try to make it more clear for everyone. The postal codes in The Netherlands look like this: 1234 AB. In one place, e.g. Amsterdam, they use the letters "AA, AB, AC, AD, AG, AH, AJ" etc. The script has to look for one of those letters with the correct combination (AA, AB, AC, AD, etc). If I enter a different combination (e.g BA), it should give me the alert "This postal code is incorrect". I have absolutely no idea how to do this, and googling didn't do much as I do not know the keywords I have to look for. Here is an example of my current, not working, script:

    var postalcodes = /(AA|AB|AC||AE||AH|AK|AL|AM|AN|AP|AR|AS|AT|AV|AW|AX|AZ|BA|BB|BC)/g;var a=document.forms["form"]["postcode"].value; if(a.match(postalcodes))  {   alert("Correct!");   return false; // Just doing return false to test the code  } 

    I also tried "a.Search()", didn't work neither. Do you guys have any idea how I can do this?

×
×
  • Create New...