Click here to Skip to main content
15,882,598 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
QuestionRadio Buttons Pin
thebiostyle24-Dec-09 8:56
thebiostyle24-Dec-09 8:56 
AnswerRe: Radio Buttons Pin
abushahin28-Dec-09 7:47
abushahin28-Dec-09 7:47 
GeneralRe: Radio Buttons Pin
thebiostyle28-Dec-09 10:34
thebiostyle28-Dec-09 10:34 
GeneralRe: Radio Buttons Pin
cjoki29-Dec-09 4:32
cjoki29-Dec-09 4:32 
GeneralRe: Radio Buttons Pin
abushahin31-Dec-09 7:45
abushahin31-Dec-09 7:45 
AnswerRe: Radio Buttons (long answer) Pin
enhzflep29-Dec-09 14:14
enhzflep29-Dec-09 14:14 
GeneralRe: Radio Buttons (long answer) Pin
thebiostyle30-Dec-09 7:31
thebiostyle30-Dec-09 7:31 
GeneralRe: Radio Buttons (long answer) Pin
enhzflep30-Dec-09 11:56
enhzflep30-Dec-09 11:56 
That's alright - been idly thinking about the question since I saw it, yesterday was the first time I had some time spare to play with.

First things first - if you don't want labels as your poll doesn't require them, then just forget about the label object. For each radio button, create an img and a br, then simply append them to the target container's child list.

To just add a 'radio-button' without a label use this code (or a suitable modification):

function addRadioButton(groupName, optionValue, tgtContainer)
{
	// create the image object
	imgObj = document.createElement("img");
	imgObj.name = groupName;
	imgObj.src = "rb1.png";
	imgObj.width = "12";
	imgObj.height = "12";
	imgObj.value = optionValue;
	imgObj.onmouseout =  function(){ changeState(this, 1); updateImg(this); }
	imgObj.onmouseover = function(){ changeState(this, 1); updateImg(this); }
	imgObj.onclick = function(){doClick(this);}

	// create the br object
	newLineObj = document.createElement("br");
	
	// add the img & br objects to the target container
	tgtContainer.appendChild(imgObj);	
	tgtContainer.appendChild(newLineObj);
}


Next,
Nope! You can't see a thing in Dreamweaver's design mode - it's a 2 line body. (Although I know dw can show live previews of sites that use a database, I couldn't tell you if it does this via a clever trick, or if it just runs the page)

I think I'm getting a little lost in your question, If I understand what you're asking, I think the code in my first post does that.
I actively encourage the downloading and modification of source code for the purpose of learning.
(It's the way we learn to speak - by copying and modification to suit the situation)

However, let me point out that I have used anonymous functions for the event handlers. Doing this allows the called function to get access to the calling object via the word 'this'.

"When the page loads it also loads the buttons as the images" - pardon?



If I may - when you saved and ran the page I provided above, how was the functionality different from what you want? What doesn't work right?
GeneralRe: Radio Buttons (long answer) Pin
thebiostyle30-Dec-09 12:17
thebiostyle30-Dec-09 12:17 
GeneralRe: Radio Buttons Pin
enhzflep30-Dec-09 13:20
enhzflep30-Dec-09 13:20 
GeneralRe: Radio Buttons Pin
thebiostyle30-Dec-09 13:34
thebiostyle30-Dec-09 13:34 
GeneralRe: Radio Buttons [modified x2] Pin
enhzflep30-Dec-09 13:41
enhzflep30-Dec-09 13:41 
GeneralRe: Radio Buttons Pin
thebiostyle30-Dec-09 13:59
thebiostyle30-Dec-09 13:59 
GeneralRe: Radio Buttons Pin
enhzflep31-Dec-09 7:04
enhzflep31-Dec-09 7:04 
GeneralRe: Radio Buttons Pin
thebiostyle31-Dec-09 7:13
thebiostyle31-Dec-09 7:13 
GeneralRe: Radio Buttons Pin
enhzflep31-Dec-09 13:05
enhzflep31-Dec-09 13:05 
GeneralRe: Radio Buttons Pin
thebiostyle31-Dec-09 18:13
thebiostyle31-Dec-09 18:13 
GeneralRe: Radio Buttons [modified] Pin
enhzflep31-Dec-09 19:41
enhzflep31-Dec-09 19:41 
GeneralRe: Radio Buttons Pin
thebiostyle31-Dec-09 21:44
thebiostyle31-Dec-09 21:44 
QuestionFind the differences betwween two arrays Pin
Marc Firth24-Dec-09 0:51
Marc Firth24-Dec-09 0:51 
AnswerRe: Find the differences betwween two arrays Pin
Luc Pattyn28-Dec-09 10:43
sitebuilderLuc Pattyn28-Dec-09 10:43 
QuestionHow to use postback in php Pin
sarang_k23-Dec-09 22:28
sarang_k23-Dec-09 22:28 
AnswerRe: How to use postback in php Pin
Marc Firth24-Dec-09 1:25
Marc Firth24-Dec-09 1:25 
Questionwarning message Pin
kamalesh574323-Dec-09 15:27
kamalesh574323-Dec-09 15:27 
AnswerRe: warning message Pin
Marc Firth24-Dec-09 1:27
Marc Firth24-Dec-09 1:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.