Click to See Complete Forum and Search --> : thank you all
tuf-web.co.uk
05-30-2003, 09:56 PM
well i'd just like to say thanks to all the people who helped me with the problems i had
and i want to show you what i have actually been creating!
A USER CUSTOMIZATION SECTION
which lets my users create their own style sheets for my site
heres the link to the project
http://www.theutherfish.com/users/
i'm sorry in advance if advertising is not allowed, even though i am only trying to show some code :)
thanks again for the help, any cooments on my work would be great and acknowledged so i can see where i'm going wrong
Jon ;)
jimson
06-01-2003, 08:39 PM
u got a damn small font..
it is blurred in my XP box... IE 6
Mordecai
06-02-2003, 12:06 AM
"Colors must be numerical..." Actually, it uses hexidecimals, which can contain letters A-F and numbers 0-9.
Looks pretty good, though. My only advise (other than the error above) is to put all the register input boxes into a table, so they're aligned better.
BuzzLY
06-02-2003, 12:52 AM
My suggestion would be to use a pop-up box to allow the user to click on the color he wants to use. You could recycle the same popup box for each input.
Also, create a sample window either on that page that changes dynamically, or a popup that I can check occasionally, so that I can see the effect my colors are going to have.
Other than that -- I'm liking it so far!
Mordecai
06-02-2003, 01:22 AM
Yes, a popup is a good idea. People tend to like visual aids.
tuf-web.co.uk
06-02-2003, 02:52 PM
ah yes i forgot about those, heres me who uses hex all the time "short term memory loss kicks in again"
yeh pop up box good idea, i'll get to work :D
thanks for the tip
and on the note that the font is 2 small, thats why i brought in a user customization, so it has its benefits kinda.
well must get back to work
Jon :)
tuf-web.co.uk
06-02-2003, 02:56 PM
errr.....i aint very good with java, does anyone know how this "pop up box" could be achieved?!
BuzzLY
06-02-2003, 03:12 PM
The page inside the pop-up box itself is simply a php page that you design, with each color clickable. When the user clicks the color, the box closes, and the appropriate field in the original window is updated.
As for the javascript itself, it's not that hard. You basically use the window.open method. Try here (http://www.echoecho.com/jswindows01.htm) for a good tutorial on popups using javascript. For more tutorials, you can just google (http://www.google.com/search?sourceid=navclient&q=javascript+pop%2Dup+tutorial) it.
If you want to VERY cool stuff to use on your site, check out brainjar.com (http://www.brainjar.com/). Even if you don't use it, they have some very cool stuff using CSS and Javascript.
Good Luck!
Elizabeth
06-02-2003, 03:15 PM
Also, there is a good pop-up script here:
http://javascript.internet.com/page-details/smart-popup.html
Provides pop-ups on click, or on hover.
Good luck!
-Elizabeth
tuf-web.co.uk
06-02-2003, 04:28 PM
hey,
thanks for the links they refreshed my mind a bit on java, i think i need another full run through of the damn thing! :S
however i am still in a mystery of how i can update a form field using this pop up page
although i have built something with php i've still got quite a way to go before i can class my self as a well learnt php coder
so if there are any tutorials or something similar to the update field script, which i need i would glady apreciate the link or code or even some help in where to go
thanks alot Jon ;)
BuzzLY
06-02-2003, 06:41 PM
First of all... this is Javascript, not Java. Even though the names are similar, they are two completely different things.
Let's say you have an input field that requests background color. You name it "bgcolor" with the name="bgcolor" attribute. Let's also say that your form is named "myform."
If you wanted to change the value of that field to "#FFFFFF" using Javascript, you use:window.document.myform.bgcolor.value="#FFFFFF"
The problem is... you need to accept input from another window. the above code will try to access the field from the popup window, and of course that wouldn't work.
What would really help is if the original window (with the form) could be accessed by the popup window. The good news is, it can. simply use the opener object, and you're good to go.
A link on your popup window that chooses blue, for example, might say:
<a href="#" onclick="sendColor('#0000FF')">#0000FF</a>
The sendColor() javascript function would simply be:
function sendColor(color) {
opener.document.myform.bgcolor.value = color;
window.close();
}
This was all done right now off the top of my head, so if there is anything in there that isn't exactly right, I apologize. If you need much more Javascript help, I suggest you go to a Javascript forum or buy a good book.
Good Luck!
tuf-web.co.uk
06-02-2003, 07:38 PM
thanks very much that worked a treat :D
and sorry about the terminology i shall remeber its javascript
not java as in the applets
thanks alot Jon :)
Weedpacket
06-02-2003, 08:35 PM
If ya really wanna get funky and have singing and dancing CSS, you could have a grid of appropriately coloured buttons instead of text links. Can look quite pretty.
table#colourpicker{border-collapse:collapse;border-spacing:0px;}
table#colourpicker td{padding:0px;}
table#colourpicker input{border:1px solid white inset;width:20px;height:20px;}
well if you have looked at my current colour picker it actually is a grid with the relevant colours on it,
but now thanks to the help from these fine peeps
it will have a little link on it updating a form
i also know that you could have just the table cells as links using onclick inside the td tag
thanks all the same ;)
btw what does OTTOMBH mean?!
BuzzLY
06-02-2003, 11:08 PM
Off the top of my head, I'd say it means
"Off the top of my bald head."
:D
tuf-web.co.uk
06-03-2003, 06:26 AM
lol, nice
Mordecai
06-03-2003, 06:38 PM
Originally posted by Weedpacket
...You could have a grid of appropriately coloured buttons instead of text links.
And you could write a program that outputs all the buttons so you don't have to do it manually. Once you have the source, just use that instead of the program.
tuf-web.co.uk
06-03-2003, 06:46 PM
aww i dont have the knowledge to do that ... yet :(
Mordecai
06-03-2003, 07:19 PM
Well, here's a starter that uses reds and yellows (it's just the color list from Paint Shop Pro):
I'm sure you can figure it out from there!
It uses Weedpacket's input.colorpicker (well, changed around). Seems his bald headed code was lacking in places and superfluous in others, but that's no matter. :)
dalecosp
06-04-2003, 01:25 AM
Originally posted by Mordecai
I'm sure you can figure it out from there!
It uses Weedpacket's input.colorpicker (well, changed around). Seems his bald headed code was lacking in places and superfluous in others, but that's no matter. :) No matter indeed. Mr. Weedpacket doesn't give out code, he gives out suggestions, ideas, and fixes. Unless you count the contests. Otherwise it's about education, and thought, thinking for one's self, so to speak...not that he's perfect, or some programming deity, but I'd cut him a tad o' slack meself....
</rant> heh, heh, was I really?:)
tuf-web.co.uk
06-04-2003, 03:55 AM
thanks that worked great :D, now for the rest of the colors :o , oh well nevermind
thanks ;)
BuzzLY
06-04-2003, 05:03 PM
I was playing around with this, being the geek that I am, and came up with this:<html>
<head>
<title>color demo</title>
<script>
<!--
function changeBG(color) {
if (document.getElementById) {
document.getElementById('colortable').style.background = color;
} else {
document.bgColor = color;
}
}
//-->
</script>
</head>
<body bgColor="#FFFFFF">
<table cellpadding='10' cellspacing='0' align='center' border='5'
style='background-color:#000000' id='colortable'>
<?php
$x=true;
$cell=0;
$cells_per_row = 2;
for ($i=0;$i<6;$i++) {
if (($cell % $cells_per_row) == 0) {
echo "<tr><td>";
} else {
echo "<td>";
}
$h1=strtoupper(dechex($i*3));
for ($j=0;$j<6;$j++) {
$h2=strtoupper(dechex($j*3));
for ($k=0;$k<6;$k++) {
$h3=strtoupper(dechex($k*3));
$x = !$x;
$color = "#" . $h1 . $h1 . $h2 . $h2 . $h3 . $h3;
if($x){$y="XXX";}else{$y="OOO";}
echo "<a href='#' onclick='javascript:changeBG(\"
$color\")'><span style='color:$color'> $y </span></a>\n";
}
echo "<br>";
$x = !$x;
}
$cell++;
if (($cell % $cells_per_row) == 0) {
echo "</td></tr>";
} else {
echo "</td>";
}
}
?>
</table>
</body>
</html>Now, the line in the middle that reads:
... is the one that you want to change. Instead of changing the background color, you could have it close the window and pass the value back to the original page. It's up to you, really.
If you want to see the code in action, go here (http://www.ultimatespin.com/projects/colortest.php). It's a little different than the code I posted, but it's the same general idea.
Ok, so I'm not like WeedPacket. I needed closure on this, and needed to see what could be done with this page. Once I did, I thought I'd share it with you, since you seem to be having trouble with the code. Remember, though, that you are not always going to get exact code when you ask for help. Most likely, you are going to get tips and hints to get you on the right track.
Good Luck!
goldbug
06-04-2003, 05:07 PM
It'd be nice if that code worked for anything other that IE. :)
Maybe grabbing the IDs of the table cells instead of the table itself. :)
BuzzLY
06-04-2003, 05:14 PM
I agree. The only reason I did that was to change the background of the table... which was not the original desired result in the first place. I just wanted to create links in the table that "did" something. Per the original requirements, they would close the window and pass the value back to opening document.
But thanks for the suggestion :)
tuf-web.co.uk
06-04-2003, 05:36 PM
thats cool buzzly nice job
and i realise that i may only get tips and guides, however this is a good thing for new learners like me because it makes us work harder, however
getting the script samples is a good bonus ;)
Weedpacket
06-04-2003, 05:44 PM
Originally posted by goldbug
It'd be nice if that code worked for anything other that IE. :) I think BuzzLY's coding to modern standards. It wouldn't work in NS4, but who cares?
I'd have done the table generation in Javascript, though (then people who have Javascript turned off don't get a nonfunctional colour picker, and a <noscript> something can be given in lieu!)
A straight port:
<script type="text/javascript">
document.write("<table cellpadding='10' cellspacing='0' align='center' border='5' style='background-color:#000000' id='colortable'>");
var x=true;
var cell=0;
var cells_per_row = 2;
var hexdigs = new Array('0','3','6','9','C','F');
for (var i=0;i<6;i++) {
if ((cell % cells_per_row) == 0) {
document.write("<tr><td>");
} else {
document.write("<td>");
}
var h1=hexdigs[i];
for (var j=0;j<6;j++) {
var h2=hexdigs[j];
for (var k=0;k<6;k++) {
var h3=hexdigs[k];
x = !x;
var color = "#" + h1 + h1 + h2 + h2 + h3 + h3;
var y = x ? 'XXX' : 'OOO';
document.write("<a href='#' onclick='javascript:changeBG(\""+color+"\")'><span style='color:"+color+"'> "+y+" </span></a>\n");
}
document.write("<br>");
x = !x;
}
cell++;
if ((cell % cells_per_row) == 0) {
document.write("</td></tr>");
} else {
document.write("</td>");
}
}
document.write("</table>");
</script>
Any number of further variants are possible: make that a colourpicker object, put the above table-writing code in a toString method, have other changeBG in another method, then snap the whole thing out into a separate .js file. To use it in the page would be a matter of
<script type="text/javascript" src="colourpicker.js"></script>
<script type="text/javascript">
mypicker = new ColourPicker(maybe with parameters);
document.write(mypicker);
</script>
I still prefer the button (or td onclick) methods - with <a> links you'd want to style away the underlining, and you get that # in the URL.
(Actually, I just noticed that the colour could be given as #+h1+h2+h3.)
BuzzLY
06-04-2003, 06:01 PM
Originally posted by Weedpacket
I think BuzzLY's coding to modern standards. It wouldn't work in NS4, but who cares?
While I usually agree with many of your comments, this one was a little harsh. If I'm getting paid and on a project, then of course I am going to code it to the specifications of the client. As I stated, I simply wanted to write something quick that tuf-web could start with and expand upon.
Your points are certainly valid, but as you have said, "I prefer," or "there are other possibilities." Everyone has a different style of coding, and one is not necessarily better than the other.
If I am overreacting, I apologize, but I don't appreciate being told that my coding standards are sub-par. I try to give good advice on this board, but I certainly am not about to do someone's entire job for them.
Weedpacket
06-04-2003, 10:49 PM
Originally posted by BuzzLY
While I usually agree with many of your comments, this one was a little harsh. If I'm getting paid and on a project, then of course I am going to code it to the specifications of the client. As I stated, I simply wanted to write something quick that tuf-web could start with and expand upon.The harshness wasn't directed at you, but at Netscape 4 (and goldbug's (false) claim that your code only worked in IE). The sooner the remaining users of that product upgrade the better (and why would they upgrade when developers continue to be compelled to cater for their special needs?)
I certainly did not intend any apparent criticism of your coding style.
BuzzLY
06-05-2003, 12:06 AM
No worries, my friend. Just having a rough day, and I suppose I just took it the wrong way.
I have to say, though, that I do get quite irritated when clients insist on supporting Netscape. While I am certainly not an advocate of Micro$oft, IE is the way to go, in my book.
Now, where did I put my Cheezits?
dalecosp
06-05-2003, 12:20 AM
Originally posted by BuzzLY
Now, where did I put my Cheezits? Last box was seen here.... (http://www.phpbuilder.com/board/showthread.php?threadid=10241487)
goldbug
06-05-2003, 08:02 AM
Originally posted by Weedpacket
The harshness wasn't directed at you, but at Netscape 4 (and goldbug's (false) claim that your code only worked in IE).
False? I think not. Maybe you should try checking it in a modern browser like Firebird or Mozilla, or Opera even, and you will see that it doesn't work as expected.
Also? Who said anything about Netscape 4? Netscape 4 is a terrible browser, and should be ignored enirely. Imho, Netscape 4 ranks even below lynx/links as far as practicality.
BuzzLY
06-05-2003, 01:29 PM
IE is a great browser. That's why AOL uses it, and they are a great company. :D
goldbug
06-05-2003, 01:37 PM
IIRC, AOL for OS X uses the Gecko (read: Mozilla) engine :)
BuzzLY
06-05-2003, 01:50 PM
FWIW, I despise AOL ;)
stolzyboy
06-05-2003, 01:58 PM
Originally posted by goldbug
False? I think not. Maybe you should try checking it in a modern browser like Firebird or Mozilla, or Opera even, and you will see that it doesn't work as expected.
You've just been called
I just downloaded BuzzLY's code, downloaded mozilla browser, downloaded firebird browser
and hmmmm..............
the code works flawlessly
goldbug
06-05-2003, 02:08 PM
You want screenshots of it not working? (You can see update in the Background: text, but the bg doesn't update.) I can provide for a handful of browsers/versions.
Don't tell me what I see with my own eyes is false.
stolzyboy
06-05-2003, 02:10 PM
yep gimme some
goldbug
06-05-2003, 02:19 PM
These are from the demo page Buzzly posted, will have screenshots of the posted code examples shortly:
Mozilla 1.3.1:
http://www.goldendance.com/proof/mozilla-1.3.1.png
Opera 7.01:
http://www.goldendance.com/proof/opera-7.01.png
These are *after* clicking one of the links/colors.
more to come if so desired.
BuzzLY
06-05-2003, 02:19 PM
Boys, boys... please don't fight. Especially over my code. It's not exactly the final standard for testing browser compatibility. LOL
to clarify, those pictures are from my page, which has changed significantly from the actual code I posted. So, you two might be testing two completely different sets of code!
In fact, my page even makes use of the Wingdings font, which is why you see n's on your page.
Please do not worry yourselves about this. I created this code simply as an example, that is all.
goldbug
06-05-2003, 02:28 PM
Buzz, you never made any claims as to the quality or cross-browser compliance of your posted code or example.
I was making my usual "cross-browser" comments, in a non-critical way (read: jokingly)
I just have a problem with people who tell me I'm wrong, without seeing it from my point of view.
And just to be thorough:
http://www.goldendance.com/proof/bc-mozilla-1.3.1.png
and
http://www.goldendance.com/proof/bc-opera-7.01.png
are the same two browsers, with the posted code, after "click". :)
stolzyboy
06-05-2003, 02:54 PM
k
well i'll get you my screenshots when i get back to work
i'm at home now
and i'm not trying to get in a pissing contest, but it works when i use them
stolzyboy
06-05-2003, 03:44 PM
FWIW goldbug, here are 3 screenshots using BuzzLY's code he supplied
Mozilla Firebird 0.6 (http://www.cloverfish.net/images/firebird.gif)
Opera 7.11 (http://www.cloverfish.net/images/opera.gif)
and this was after clicking on a color link
BuzzLY
06-05-2003, 03:50 PM
That's cool... but you have made my point. You used the code I posted in the tags. goldbug is using the link I supplied, in which the code has changed. Now, both of you are right. Shake hands, and have some Cheezits.
goldbug
06-05-2003, 03:51 PM
And you didn't change any code atall? I just find it odd that the same code (I copy/pasted) works differently for you in virtually the same browser setup.
goldbug
06-05-2003, 04:01 PM
Originally posted by goldbug
And you didn't change any code atall? I just find it odd that the same code (I copy/pasted) works differently for you in virtually the same browser setup.
Hint: the above code does not work In non IE browsers (or at least, the half-dozen i've checked), for one minute reason....
the word javascript shouldn't have a space in it :)
Having a space results in Gecko rendering engines throwing the error:
Error: missing ; before statement
Source Code:
java script:changeBG("#660033")
(copy/pasted from Venkman)
I'll let this one go. :)
stolzyboy
06-05-2003, 04:05 PM
hmmmmmm.........
hard to say, as i changed nothing
and buzz i don't really like cheezits
i'll just have a snicker bar and goldbug can have whatever he wants
goldbug
06-05-2003, 04:09 PM
Originally posted by stolzyboy
i'll just have a snicker bar and goldbug can have whatever he wants
Whatever I want!?? OOH GOODY, I'll start with a Dahlback RSi Golf and maybe a yacht, assuming I don't have to actually eat them.
Just fyi, if you are wondering what the hell a Dahlback RSi Golf is: (not official dahlback racing page) http://weach.com/weachy/5cylinder/cool/dahlback.htm
BuzzLY
06-05-2003, 04:31 PM
Ok, apparently I have to pound you two numbskulls over the head with sledge... better yet: Hey Elizabeth, let me borrow your pink fuzzy LART!
The code I posted in this post (http://www.phpbuilder.com/board/showthread.php?s=&threadid=10241602#post10355835) is the one stolzyboy is using. The "java script" with the space is something vbulletin does, most likely to prevent people from creating bad juju on pages. You'll just have to manually remove the space yourself.
The code that goldbug is using was given in a link in the same post. Here (http://www.ultimatespin.com/projects/colortest.php) is that link. I have modified that code somewhat -- the main change that you two are having a problem with being that I modified it to change the table background color using the getElementById() method. Apparently, mozilla does not like its tables having id tags (silly), and ignores it. Therefore, the code FROM THE LINK does not work correctly in mozilla.
Ok, are we clear as mud? Or do I have to use Beth's LART on you?
goldbug
06-05-2003, 04:42 PM
I dunno, should the LART truly be feared? Or is fear of the LART something reenforced by society, when in fact the LART is a misunderstood outcast, forced to live under an overpass, eating cans of beans rife with botulism.
Cmon everybody, hug the LART.
BuzzLY
06-05-2003, 04:51 PM
I dunno... come a little closer and we'll find out :D
stolzyboy
06-05-2003, 04:58 PM
i'm generally not scared of LART, but when it come's to Beth's LART, i am shivering to death (in fright) :eek:
dalecosp
06-05-2003, 05:10 PM
originally posted by Weedpacket
give me a big enough stick and a firm place to stand and I shall LART the earth! (http://www.phpbuilder.com/board/showthread.php?threadid=10218925&perpage=15&highlight=firm%20place%20to%20stand%20and%20i%20shall%20lart%20the%20earth&pagenumber=5)
Bunkermaster
06-05-2003, 08:08 PM
GoldBug lookie :D
text is in french but the whole thing speaks for itself I think :D
GoldBug, please, PLEASE tell me you didn't send us to a page that loads up sounds...:eek:
Weedpacket
06-06-2003, 12:09 AM
Originally posted by BuzzLY
I modified it to change the table background color using the getElementById() method. Apparently, mozilla does not like its tables having id tags (silly), and ignores it. Therefore, the code FROM THE LINK does not work correctly in mozilla.
In fact, Mozilla has no problem with giving id attributes to <table> elements, and accessing them through Javascript (you'll note that the previously-posted code (with vBulletin's deliberate "java script" bug) also identifies the table via getElementById). I think the problem with the line:
document.getElementById('colortable').style.background = "Current: " + color;
is that "Current: " thingy. Change the line to
document.getElementById('colortable').style.backgroundColor= color;
And everybody's happy.
Now I've wasted enough posts on this squabble
goldbug
06-06-2003, 09:39 AM
Originally posted by BuzzLY
GoldBug, please, PLEASE tell me you didn't send us to a page that loads up sounds...:eek:
It loads sounds?
OHHHH I see.... the bgsound tag. Yeah. Firebird ignores those. :)
BuzzLY
06-06-2003, 10:27 AM
Originally posted by Weedpacket
document.getElementById('colortable').style.background = "Current: " + color;
...that "Current: " thingy.
Doh!
/me slaps forehead. Ok, I fixed that. Goldbug, I think you'll find my page (http://www.ultimatespin.com/projects/colortest.com) works now, with the exception of Mozilla not supporting the Wingdings font.
I agree... let's let dead horses be bygones.
Elizabeth
06-06-2003, 10:33 AM
Now that this has been resolved, I'm putting the LART back in it's holster... but you guys better mind your P's & Q's though ;)
-Elizabeth
dalecosp
06-06-2003, 10:38 AM
Originally posted by Elizabeth
Now that this has been resolved, I'm putting the LART back in it's holster... but you guys better mind your P's & Q's though ;)
-Elizabeth The masochist in me suddenly feels quite disappointed, but my health insurance company thanks you from the bottom of its portfolio... :)
goldbug
06-06-2003, 12:14 PM
Originally posted by Bunkermaster
GoldBug lookie :D
text is in french but the whole thing speaks for itself I think :D
But check THIS out! :
http://homepage2.nifty.com/ztath/starthp/subpage07.html
For the life of me, I can't figure out what the hell these are about. Maybe if anyone here can read any of those pages, they'd like to enlighten me.
stolzyboy
06-06-2003, 01:41 PM
well according to the look of most of them
these folks watch too much "Power Ranger"
goldbug
06-06-2003, 01:45 PM
My sister informs me that in some parts of the eastern hemisphere, trucks and the like are decorated in order to "ward off evil spirits" or something. Perhaps this is just an EXTREME extension of that practice.
Either that, or she's full of crap. :)
I've got my money on "full of crap"
stolzyboy
06-06-2003, 01:55 PM
ya wanna place a $20 on that bet for me
i think she may have lost it
i'm sticking with the "Power Rangers" avenue
BuzzLY
06-06-2003, 02:34 PM
At my apartment, there are lots of people here that have those souped up little matchbox cars. I call them the Fast and the Curious. It's quite funny watching them parade their cars back and forth.
goldbug
06-06-2003, 02:40 PM
Yeah, the tuner scene went downhill, and fast. Now it's all a bunch of teenagers rolling around in Civics with huge wings and stickers slapped on them. Kinda annoying.
Don't get me wrong, I *will* be modding my "matchbox" car once I get it payed off, but nothing really visual. Only stuff that will actually make it faster/handle better. (read: sleeper).
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.