stefan1294
-
Posts
15 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by stefan1294
-
-
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;}
-
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.
-
Thank you. I am working on a project, which will not be released in the public, so I'll justu se the word-wrap propYou 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.
-
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.
-
Thank you very much!
-
My question is in the title. How will I be able to get something like that? I did some research, I was checking a couple of tutorials, etc.. But no result, so I'd like to ask it here. Edit: Of course my idea is just to update a 'div' when they go to the about page, for example.
-
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
-
It seems to work now, thanks a lot
-
Yep, works fine Edit: I just did this to see what the result would be:OK, have you checked that a exists?alert(a);
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
-
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.If you're using Firefox, press Control+Shift+J to open the error console.
Yeah, the code is in a function.Is this code in a function? You'll need to execute the code after the postal code has been written using an event handler.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">
-
I am not sure where I can find thatBe sure to check the error console.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
-
I fixed that already - The real problem is not fixedNo, the two bars are actually one of the mistakes in your expression. Have you read my post? One of the problems is that you're outputting "Correct" when the postal code is wrong. -
Hey Ingolme. Thank you for replying. Unfortunately your "||" method didn't fix it for me.
-
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?
Keeping a div ~50px away from a div above
in CSS
Posted