Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Nasreen
HTML-JAVASCRIPT
1 Answer(s)      a year and 7 months ago
Posted in : JavaScript Questions


There are two radio button and one text area. The values should be generated on the text area based on the selection of radio buttons. Hardcoding is also allowed.


Advertisement
View Answers

May 15, 2013 at 3:36 PM


hi friend,

You can use the following code

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Radio Button Example</title>
<script type="text/javascript">
function changeValue()
{
    var test = document.getElementsByName("a");
    var t = document.getElementsByName("textbox");
    var text = null;
    for(var elem in test)
    {
        if(test[elem].checked)
        {
            // got the element which is checked
            t = test[elem].value;            
            //alert(t);            
            //document.getElementsByName("textbox").innerHTML = ""+t;
            //Changing value of textbox
            document.getElementById("t1").value = ""+t;                
        }
    }
}
</script>
</head>
<body>
<form name="form1" action="#">
 <p>
  Your Choice : <input type = "text" id ="t1" name="textbox"/>
 </p>
 <p>
 <input type="radio" name="a" value="Fruits" onclick="changeValue()">Fruits</input><br/>
 <input type="radio" name="a" value="Chocolate" onclick="changeValue()">Chocolate</input><br/>
 <input type="radio" name="a" value="Cookie" onclick="changeValue()">Cookie</input><br/>
 <input type="radio" name="a" value="Icecream" onclick="changeValue()">Icecream</input> 
 </p>
</form>
</body>
</html>

Thanks.



Related Tutorials/Questions & Answers:
Html/JavaScript code - JSP-Servlet
Html/JavaScript code  I have 2 JSPs JSP1 and JSP2. 1.in JSP1 i have a table being displayed using the tag and cells in it contain links(huge amount of data is displayed in paged manner). 2.When click on a link, it leads
HTML-JAVASCRIPT
HTML-JAVASCRIPT  There are two radio buttons. On clicking a radio button, a text area must be created. If a first radio button is clicked, a text area is created. When the second button is clickHTed, a new text area must
Advertisements
HTML-JAVASCRIPT
HTML-JAVASCRIPT  There are two radio button and one text area. The values should be generated on the text area based on the selection of radio buttons. Hardcoding is also allowed
how to validate the telephone number without using jquery in html with javascript
how to validate the telephone number without using jquery in html with javascript  how to validate the telephone number without using jquery in html with javascript
mini project using html,javascript and ms access with source code
mini project using html,javascript and ms access with source code  I want a mini project which uses html and java script and backend as ms access with source code. plz send its important and urgent
On HTML and JavaScript - Java Beginners
On HTML and JavaScript  Hi I have a SelectBox for ex i want... slection box using in javaScript Select Date and month using JavaScript -Select- 01 02 03 04 05 06 07 08 09 10 11 12 13
changing an image based on checking checkbox using HTML & JavaScript, Please put div blocks
changing an image based on checking checkbox using HTML & JavaScript, Please put div blocks   Hello, PLease check the below code, and let me know...;script type="text/javascript"> function showImage
How to display user entered information using HTML and JavaScript
How to display user entered information using HTML and JavaScript. We are going to describe How to display user entered information using HTML and JavaScript. First of all we have created HTML form with two text fields "
coding for horizontal menubar using using html or javascript - JSP-Servlet
coding for horizontal menubar using using html or javascript  hii friends, i wanted to implement horizontal menubar in my project tht wil open the links to diffrnt pages kindly help
Guise
Guise       Guise provides an elegant server-side component architecture that doesn't require developers to write HTML or JavaScript (Demo)it's a true application framework, written
JavaScript createAttribute method
JavaScript createAttribute method       In the HTML JavaScript we have one of the important method createAttribute which can be used to create the html tag's attribute
JavaScript array functions
JavaScript array functions We are going to describe How to create JavaScript Array function. Now we have created JavaScript Array function by help of HTML and JavaScript language.In this simple example we have used basic
javaScript
javaScript  How to open a browser window that cannot be resized? (HTML + Javascript
Echo 2
Echo 2       Echo 2 allows you to code Ajax apps in pure Java (Demo)which automatically generates HTML and Javascript. Read full Description
IFrame.IN- Just Another Encode Tools
IFrame.IN- Just Another Encode Tools       This site will help you quickly encode and obfuscate your HTML/JavaScript code many different methods, as well as generate browser redirect
flowcharts using javascript/HTML - Development process
flowcharts using javascript/HTML  Hi I want to create flowchart diagram using html/javascript.. is that possible.. please guide me Thanks!  Check this linkhttp://www.roseindia.net/jdbc/jdbc-driver-and-its-types.shtml
how to print HTML using javascript or Jquery
how to print HTML using javascript or Jquery  is there any way to print a document(created using Html and javascript) without using window.print, which works for all the browser specially chrome and firefox, I have used
Html form using JavaScript to display the table content
Html form using JavaScript to display the table content  HI There, Greetings, I am new to this java and I need your assistance. I have created... want to write a Html JavaScript coding to display the content from database
javaScript+Html
javaScript+Html  print("code sample");(Use ExtJS 3 or 4) and create following (HTML, Javascript,ExtJS) a. Create a single page application divided into 4 sections - Top Header, Footer,Left Navigation (Tree), Center Panel
Dynamic web pages
Dynamic web pages  hi, i am just creating a web page using html and javascript. i want to give it a eye catching look using javascript. I just want to know how could i make it happen using javascript functions,like zoom in &
Ajax method
. thism should be done using ajax,html,javascript. And xml should contain data
Ajax method
. thism should be done using ajax,html,javascript. And xml should contain data
Simple HTML example
can use HTML with JavaScript to create more dynamic WebPages. These days HTML...Simple HTML example In this section we will give you very simple example of a HTML page. After reading this page you should be able to create simple HTML
java web application without running tomcat
java web application without running tomcat  I did a project by using jsp,html,javascript,css,tomcat,editplus and MSAccess as backend..i created set up file by using NSIS tool..but the problem when i will the project to some
Dynamic html examples
Dynamic html examples  Hi, What is Dynamic HTML? Explain with dynamic html examples. Thanks   Hi, DHTML stands for Dynamic HTML and is uses the HTML, JavaScript, DOM, & CSS in a program. Following is very simple
Servlets - Servlet Interview Questions
be deployed on the any servlet/jsp container. The .war file contains jsp, html, javascript and other files for necessary for the development of web applications
dropdown wth checkboxes - Design concepts & design patterns
dropdown wth checkboxes  Hi Friends, Instead of using Ctrl key i want to put checkboxes inside the dropdown,then we can check the options whatever we want. Please give me the html code(only html & javascript). Thanks
How to handle enter key in javascript
of button.   Enter key event in html JavaScript This is very simple. You...How to handle enter key in javascript  Can any one tell me how to handle the enter key event on a Button in HTML. Like in my simple HTML page i want
Ajax Training
. Prerequisites: Candidate should have knowledge of  HTML, JavaScript and CSS... (Asynchronous JavaScript and XML) is a web development technique used for developing website... application without refreshing your page. Ajax uses JavaScript, XMLHttpRequest
multiuser in java/jsp? - JSP-Servlet
multiuser in java/jsp?  Hi!!! Rose India Team, Kindly let me know what is exact meaning of multiuser in java? I made an web application using jsp and oracle with html and javascript. It should be made multiuser. So
jsp definition - JSP-Servlet
side programming language. It is combination of html, javaScript, java, xml... side programming language.  Hi friend don't get confused with HTML that is embedded in jsp's. If any HTML code in jsp's is placed in out.println("HTML
Advertisements
 

 

 

DMCA.com