•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 402,003 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,455 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 2101 | Replies: 13
![]() |
•
•
Join Date: Nov 2006
Posts: 11
Reputation:
Rep Power: 2
Solved Threads: 0
oK this is what I have been able to do. Can you tell me how to make one of the color as the defult select and how to make the bard for each % (would I just need to creat a image and import it for each)?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
</head>
<table width='100%' cellpadding=0 cellspacing=4 border=0>
<td><table width=100 cellspacing=0 cellpadding=0 border=0 align=left bgcolor='#001894'><tr><td>
<table width=266 height="243" border=0 cellpadding=0 cellspacing=1>
<tr><td><font color='#FFFFFF' face='verdana,arial' size=1><b> color</b></font></td><td width="81"><font color='#FFFFFF' face='verdana,arial' size=1> <b>%</b></font></td></tr>
<tr bgcolor='#FFFFFF'><td width=111><form name="form1" method="post" action="">
<input name="radiobutton" type="radio" value="radiobutton">
Blue
</form></td>
<td nowrap><font face='verdana,arial' size=1> 10%</font></td></tr>
<tr bgcolor='#FFFFFF'><td width=111>
<form name="form2" method="post" action="">
<input name="radiobutton" type="radio" value="radiobutton">
Red
</form></td><td><font face='verdana,arial' size=1> 10%</font></td></tr>
<tr bgcolor='#FFFFFF'><td width=111>
<form name="form3" method="post" action="">
<input name="radiobutton" type="radio" value="radiobutton">
Violet
</form></td><td><font face='verdana,arial' size=1> 30%</font></td></tr>
<tr bgcolor='#FFFFFF'><td width=111><form name="form4" method="post" action="">
<input name="radiobutton" type="radio" value="radiobutton">
Green
</form></td>
<td><font face='verdana,arial' size=1> 50% </font></td></tr></table>
</td></tr></table>
</td></tr></table>
</span></TD>
</TR>
</TABLE>
</TABLE>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
</head>
<table width='100%' cellpadding=0 cellspacing=4 border=0>
<td><table width=100 cellspacing=0 cellpadding=0 border=0 align=left bgcolor='#001894'><tr><td>
<table width=266 height="243" border=0 cellpadding=0 cellspacing=1>
<tr><td><font color='#FFFFFF' face='verdana,arial' size=1><b> color</b></font></td><td width="81"><font color='#FFFFFF' face='verdana,arial' size=1> <b>%</b></font></td></tr>
<tr bgcolor='#FFFFFF'><td width=111><form name="form1" method="post" action="">
<input name="radiobutton" type="radio" value="radiobutton">
Blue
</form></td>
<td nowrap><font face='verdana,arial' size=1> 10%</font></td></tr>
<tr bgcolor='#FFFFFF'><td width=111>
<form name="form2" method="post" action="">
<input name="radiobutton" type="radio" value="radiobutton">
Red
</form></td><td><font face='verdana,arial' size=1> 10%</font></td></tr>
<tr bgcolor='#FFFFFF'><td width=111>
<form name="form3" method="post" action="">
<input name="radiobutton" type="radio" value="radiobutton">
Violet
</form></td><td><font face='verdana,arial' size=1> 30%</font></td></tr>
<tr bgcolor='#FFFFFF'><td width=111><form name="form4" method="post" action="">
<input name="radiobutton" type="radio" value="radiobutton">
Green
</form></td>
<td><font face='verdana,arial' size=1> 50% </font></td></tr></table>
</td></tr></table>
</td></tr></table>
</span></TD>
</TR>
</TABLE>
</TABLE>
•
•
Join Date: Jul 2006
Location: Deptford, London
Posts: 943
Reputation:
Rep Power: 5
Solved Threads: 47
that doesn't look like good HTML...elements like "html" and "head" need to contain some data.... you're missing a body (which isn't neccessarily 'wrong', but it's good practice to have one).. and this indicates an illegal construct somewhere :
it's never possible to close one table and then another straight away... there's gotta be a cell and a row and preferably a tbody element between a table and any kind of content.
for "showing a percent" (using Javascript):
that will give you some funky variable-length bars... if you put them in a fixed width element, and float them to the left or to the right; they will be even funky-er.
for a default radio selection...
first of all, give each radio a meaningful value: <input name="radiobutton" type="radio" value="radiobutton"> for all of them isn't going to mean much to you when you want to use the data. it's correct to give them all the same name, but give them each a relevant value.
and then, to set a default:
</TABLE> </TABLE>
it's never possible to close one table and then another straight away... there's gotta be a cell and a row and preferably a tbody element between a table and any kind of content.
for "showing a percent" (using Javascript):
function setLengthPercent(ident,percent){
document.getElementById(ident).style.width=percent+"%";
}for a default radio selection...
first of all, give each radio a meaningful value: <input name="radiobutton" type="radio" value="radiobutton"> for all of them isn't going to mean much to you when you want to use the data. it's correct to give them all the same name, but give them each a relevant value.
and then, to set a default:
<input name="radiobutton" type="radio" value="something_relevant" checked="yes"> Last edited by MattEvans : Dec 14th, 2006 at 3:18 pm.
If it only works in Internet Explorer; it doesn't work.
•
•
Join Date: Jul 2006
Location: Deptford, London
Posts: 943
Reputation:
Rep Power: 5
Solved Threads: 47
prefererably between some script tags in your markup somewhere, or in a linked javascript file... even better, you could put it in a handy library of JavaScript functions for graphing things.... but only if you have NOTHING better to do.
As vishesh said; you should probably learn the basics of JavaScript and the HTML DOM.... W3C sites are helpful to begin with:
http://www.w3schools.com/htmldom/default.asp
http://www.w3schools.com/js/default.asp
http://www.w3schools.com/js/js_obj_htmldom.asp
read through those tutorials in order (for each one, keep clicking the 'next' button until you think you know it, or you hit the end).
occasionally, when a tutorial says "try it yourself", give it a try (you can do it on the site).
once you know what that bit of script does (which you will) you will know how to use it, and hopefully where to put it...
As vishesh said; you should probably learn the basics of JavaScript and the HTML DOM.... W3C sites are helpful to begin with:
http://www.w3schools.com/htmldom/default.asp
http://www.w3schools.com/js/default.asp
http://www.w3schools.com/js/js_obj_htmldom.asp
read through those tutorials in order (for each one, keep clicking the 'next' button until you think you know it, or you hit the end).
occasionally, when a tutorial says "try it yourself", give it a try (you can do it on the site).
once you know what that bit of script does (which you will) you will know how to use it, and hopefully where to put it...
If it only works in Internet Explorer; it doesn't work.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: Need to Scroll to div element
- Next Thread: for validation - text box and drop down menu


Linear Mode