View Full Version : Sharing field values

06-06-2007, 04:42 PM
I have an INPUT field which calls the following function; dup.
The function should do two things:
1) write the field value to the page - This works beautifully
2) share textfield INPUT value with INPUT radio button - Not working

I can't give both INPUTs the same id.

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

//PROBLEM CODE HERE - trying to share value of Instructor with FacultyName
var Teacher = document.forms["form1"]["Instructor"];
document.forms["FacultyName"] = Teacher.value;

<!-- INPUT textfield -->
<input id="Instructor" type="text" name="Instructor" value="" onBlur="dup(this.value)">

<!-- Radio button INPUT -->
<input checked type="radio" name="FacultyName" id="Name" value="">

06-06-2007, 08:48 PM
do a function that will grab the value of the text field after every kestroke (use onkeyup on the text field) the function should grab the value and then set it to the radio buttons value.


<input type=text id=text1 value='' onkeyup="sharevalue(this.value);">
<input type=radio checked id=radio1 value=''>
<script type=text/javascript>

function sharevalue(val){


the above is just an example and im sure you want to work on multiple textfields/radio buttons. but this should get you pointed in the right direction.

06-06-2007, 09:55 PM
I'll play with it and see what can be done. Thanks!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum