RE: html box... again!

  • From: "Holdsworth, Lynn" <Lynn.Holdsworth@xxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 19 Jun 2009 08:42:04 +0100

Hi Alex,

So what happens when you try to run the script? Do you get the alert box
or does the colour just not change?

A couple of things:

1. Check the line that says:
bx=document.getElementById("box"
If punctuation isn't getting mangled in your email, you need to add a
closing bracket and a semicolon to the end of this line.

2. You need to put a hash sign # in front of the hex colour, example
#33ffcc .

Cheers, Lynn

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Alex Hall
Sent: 19 June 2009 04:10
To: programmingblind@xxxxxxxxxxxxx
Subject: html box... again!

Okay, I am getting annoyed! My simple, 500x500 px box is still not
showing.  Below is the code to make the box, followed by the function
that I use to update said box's color (the form fields are okay, and the
translation to hex works).  As usual, my email will lack punctuation, so
ignore things like missing < or > signs, semicolons, braces, and so on.

Box code:
<div align="center" id="box" style="height:500; width:500;
color:black"></div

Script to change box's color to the codes in three text boxes, one for
red, one for green, and one for blue:

<script language="javascript"
function update(){
try{
red=eval(f.r.value).toString(16);
green=eval(f.g.value).toString(16);
blue=eval(f.b.value).toString(16);
if(red.length==1){
red=0+""+red;

if(green.length==1){
green=0+""+green;

if(blue.length==1){
blue=0+""+blue;

col=red+""+green+""+blue;
bx=document.getElementById("box"
bx.style.color=col;
document.getElementById("eml").innerHTML="Code: "+col+"<br><a
href='mailto:mehgcap@xxxxxxx"subject="+col+";'>Email me the color</a>";

catch(e){
alert(e+" in update(): "+e.description);


</script

Have a great day,
Alex
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind



-- 
DISCLAIMER:

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged.  If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system.

RNIB endeavours to ensure that emails and any attachments generated by
its staff are free from viruses or other contaminants.  However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent
those of RNIB.

RNIB Registered Charity Number: 226227

Website: http://www.rnib.org.uk



This message has been scanned for viruses by Websense Hosted Security - 
http://www.websense.com/content/HostedEmailSecurity.aspx

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: