Radio Button Select Event In a Java Script - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Radio Button Select Event In a Java Script

ramyaramramyaram Posts: 5Member
hi, I am new to Ajax, i am developing a program to change the values shown in the div which will be entered by the user in the text box in a html file. for that I am using a radio button for each text box & i had made the setting in such a way that at a time only 1 radio button will be selected depending on the selection, particular values of the field will be changed in the div.
for changing the text size, text font, family i had used a selection button.
now my problem is i am unable to change the changes made by the user , which should be displayed in the div , i was able to change each field values individually , before i inserted radio button into the code, now i am unable to change bcz i am unable to pass the changes into the div values sepending on the radio button selection, please help me,

here is my code





/* Function to Display the Changes*/

function check(browser)
{

document.getElementById("answer").value=browser;
fntFmly = document.getElementById('selectFamily');
fntSize = document.getElementById('selectSize');
fntStyle= document.getElementById('selectStyle');
text1 = document.getElementById('answer');
//document.getElementById("text").style.fontStyle;
//document.getElementById("txt").style.fontStyle;
text1.style.fontFamily = fntFmly.value;
text1.style.fontSize = fntSize.value;
text1.style.fontStyle = fntStyle.value;
var d = document.getElementById('answer')
d.style.height = fntSize + 2 + 'px';
d.style.width = fntSize + 2 + 'px';
}

/* Function to Display the Values entered by User into the Div*/
function displayname(obj,calledBy)
{
var name1;
name1=obj.value;
if(calledBy==0)
document.getElementById("divName").innerHTML=name1;
else if(calledBy==1)
document.getElementById("divDesg").innerHTML=name1;
else if(calledBy==2)
document.getElementById("divAddrs").innerHTML=name1;
else if(calledBy==3)
document.getElementById("divAddrs1").innerHTML=name1;
else if(calledBy==4)
document.getElementById("divArea").innerHTML=name1;
else if(calledBy==5)
document.getElementById("divCity").innerHTML=name1;
else if(calledBy==6)
document.getElementById("divPin").innerHTML=name1;
else if(calledBy==7)
document.getElementById("divPhone").innerHTML=name1;
else if(calledBy==8)
document.getElementById("divPhone").innerHTML=name1;
}





Name :       











Designation:











Address:     












Your favorite browser is:




























image


















Algerianl
verdana
Arial Black



10px
11px
12px
13px
14px
15px
16px
17px
18px



italic
normal
oblique

























Thanks in Advance

Comments

  • ramyaramramyaram Posts: 5Member
    I had got it done what i wanted

    : hi, I am new to Ajax, i am developing a program to change the values
    : shown in the div which will be entered by the user in the text box
    : in a html file. for that I am using a radio button for each text box
    : & i had made the setting in such a way that at a time only 1 radio
    : button will be selected depending on the selection, particular
    : values of the field will be changed in the div.
    : for changing the text size, text font, family i had used a selection
    : button.
    : now my problem is i am unable to change the changes made by the user
    : , which should be displayed in the div , i was able to change each
    : field values individually , before i inserted radio button into the
    : code, now i am unable to change bcz i am unable to pass the changes
    : into the div values sepending on the radio button selection, please
    : help me,
    :
    : here is my code
    :
    :
    :
    :
    :
    : /* Function to Display the Changes*/
    :
    : function check(browser)
    : {
    :
    : document.getElementById("answer").value=browser;
    : fntFmly = document.getElementById('selectFamily');
    : fntSize = document.getElementById('selectSize');
    : fntStyle= document.getElementById('selectStyle');
    : text1 = document.getElementById('answer');
    : //document.getElementById("text").style.fontStyle;
    : //document.getElementById("txt").style.fontStyle;
    : text1.style.fontFamily = fntFmly.value;
    : text1.style.fontSize = fntSize.value;
    : text1.style.fontStyle = fntStyle.value;
    : var d = document.getElementById('answer')
    : d.style.height = fntSize + 2 + 'px';
    : d.style.width = fntSize + 2 + 'px';
    : }
    :
    : /* Function to Display the Values entered by User into the Div*/
    : function displayname(obj,calledBy)
    : {
    : var name1;
    : name1=obj.value;
    : if(calledBy==0)
    : document.getElementById("divName").innerHTML=name1;
    : else if(calledBy==1)
    : document.getElementById("divDesg").innerHTML=name1;
    : else if(calledBy==2)
    : document.getElementById("divAddrs").innerHTML=name1;
    : else if(calledBy==3)
    : document.getElementById("divAddrs1").innerHTML=name1;
    : else if(calledBy==4)
    : document.getElementById("divArea").innerHTML=name1;
    : else if(calledBy==5)
    : document.getElementById("divCity").innerHTML=name1;
    : else if(calledBy==6)
    : document.getElementById("divPin").innerHTML=name1;
    : else if(calledBy==7)
    : document.getElementById("divPhone").innerHTML=name1;
    : else if(calledBy==8)
    : document.getElementById("divPhone").innerHTML=name1;
    : }
    :
    :
    :
    :
    :
    :

    :
    :
    :
    : Name :       
    :
    :
    :
    :
    :
    :
    :

    :
    :
    :
    : Designation:
    :
    :
    :
    :
    :
    :
    :

    :
    :
    :
    : Address:     
    :
    :
    :
    :
    :
    :
    :

    :
    :
    :

    : Your favorite browser is:
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :

    : image
    :

    :
    :

    :

    :
    :

    :

    :
    :

    :

    :
    :
    :
    :
    :
    :
    :
    :
    : Algerianl
    : verdana
    : Arial Black
    :
    :
    :
    : 10px
    : 11px
    : 12px
    : 13px
    : 14px
    : 15px
    : 16px
    : 17px
    : 18px
    :
    :
    :
    : italic
    : normal
    : oblique
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    : Thanks in Advance
    :

Sign In or Register to comment.