Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How can this be achieved

    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:
    Code:
    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:
    Code:
    <span id="sameName"></span>
    <input checked type="radio" name="FacultyName" id="Name" value="">

  • #2
    New Coder
    Join Date
    Apr 2007
    Location
    Silicon Valley California
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thanks for tip.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •