...

View Full Version : How can this be achieved



h8ids
06-06-2007, 10:22 PM
I'd like to share a Node value with an element value.
Presently, the <SPAN> tag does receive a VALUE from an INPUT textfield.

Now I'd like to share the VALUE with the the RADIO button.

Code populating the <SPAN> tag:


function dup(what)
{
var createText = document.createTextNode(what);
var cell = document.getElementById('sameName');
if(cell.hasChildNodes())
{
while(cell.childNodes.length >= 1 )
{
cell.removeChild( cell.firstChild );
}
}
cell.appendChild(createText);
}


Form code:


<span id="sameName"></span>
<input checked type="radio" name="FacultyName" id="Name" value="">

cyberlogi
06-06-2007, 11:50 PM
You can't 'share' the value, but you can apply an 'onchange' event to the radio button and then pass its value into your 'dup' function using the callback function.

h8ids
06-08-2007, 09:35 PM
Thanks for tip.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum