Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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













































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
    :

    :
    :

    :

    :
    :

    :

    :
    :

    :

    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    : Thanks in Advance
    :

Sign In or Register to comment.