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




Have Programming Question? Ask it here!
 
 
 


Nasreen
HTML-JAVASCRIPT
1 Answer(s)      11 months ago
Posted in : JavaScript Questions


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 be created hiding the previous text area which is created on clicking the first radio button and vice versa


Advertisement
View Answers

May 15, 2013 at 6:13 PM


hi friend,

You may try the following code for solution of your query :

<!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">
var counterTextArea = 0;
var limit =4;
function addInput(divName)
{
    var test = document.getElementsByName("a");
    var t = document.getElementsByName("textbox");
    var text = null;
    for(var elem in test)
    {
        if(test[elem].checked)
        {
            t = test[elem].value;
            var newdiv = document.createElement('div');
            var input = document.createElement('textarea');
            input.name = 'post';
            input.maxLength = 50;
            input.cols = 2;
            input.rows = 2;         
            document.getElementById(divName).appendChild(input);
            var divEle = document.getElementById('dynamicInput');
            var divNodeLength = divEle.childNodes.length;
            if(divNodeLength > 0)
            {
                if(counterTextArea == limit)
                {
                    divEle.removeChild(divEle.childNodes[1]);
                    alert("You have reached the limit of adding " + counterTextArea + " inputs");
                    test[elem].checked=false;                   
                    counterTextArea = 0;                                                                    
                }
                else{
                divEle.removeChild(divEle.childNodes[0]);
                divEle.innerHTML = ""+t + (counterTextArea + 1) +": ";
                divEle.appendChild(input);
                counterTextArea++;
                }               
            }               
        }
    }
}
</script>
</head>
<body>
<form name="form1" action="#">

 <div id="dynamicInput">
 Textarea : 
 </div>  
 <p>
 <input type="radio" name="a" value="Fruits" onclick="addInput('dynamicInput');">Fruits</input><br/>
 <input type="radio" name="a" value="Chocolate" onclick="addInput('dynamicInput');">Chocolate</input><br/>
 <input type="radio" name="a" value="Cookie" onclick="addInput('dynamicInput');">Cookie</input><br/>
 <input type="radio" name="a" value="Icecream" onclick="addInput('dynamicInput');">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
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
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
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
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 &
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
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
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
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
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
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
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
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
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
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
Introduction to Dojo
with the Dojo framework. Dojo is another great JavaScript framework...?  Dojo is JavaScript framework released as open source software. This JavaScript toolkit provides many components to develop rich
How to hide HTML code from user? - Security
of your site, as whether with html or javascript, you are providing instructions...How to hide HTML code from user?  Hi All, I am trying to provide... viewing HTML source code. Can any one guide me for this topic? Thanks
java - Java Beginners
(HTML, Javascript, etc.) to develop the application. If you want to know
JavaScript where to place in HTML
JavaScript where to place in HTML   Where to place JavaScript code into HTML Code?   Placing JavaScript code into HTML Code In HTML.... See the example given below. Declaring JavaScript in HTML Head Tag <
stuts java script validation is not working.
; <html:javascript formName="logonForm"/> > Enter name:<html:text property="username"/> > Enter pass:<... and validation.xml file's code. pls help --of jsp page-- > <html:form action
How to substring in JQuery?
will extracted till end of the string. Here is the complete example html and javascript code... JavaScript"; I just want to take the value JavaScript from the above variable..., There is no need to use the jQuery for getting the smaller from a big string. JavaScript
Example program to pass value from Html to java script
value from HTML to JavaScript </TITLE> <script language="JavaScript... Example program to pass value from Html to java script... html code to java script easily. To show this we have created an example Html page
Ajax Web Framework, Frameworks for Ajax
the knowledge of HTML, CSS, JavaScript and Ajax. In this kind of framework developer... into Ajax, HTML and JavaScript. In such framework high level language is used... HTML and JavaScript for Ajax support. The server-side framework renders
AJAX Web-Framework
the knowledge of HTML, CSS, JavaScript and Ajax. In this kind of framework developer authors the HTML and the api directly interacts with the HTML elements..., HTML and JavaScript. In such framework high level language is used which
Jakarta Struts Interview Questions
;    Q: What is Jakarta Struts Framework... applications with Java. Q: What is ActionServlet? A: The class... for handling all the requests.    Q: How you will make available any
Web application? - Java Interview Questions
(such as HTML, JavaScript, Java, etc.) and reliant on a common web browser... necessary for the creation of Web pages, including HTML, XML, Flash, Perl, CSS
how to create a dynamic website - Servlet Interview Questions
how to create a dynamic website  create a dynamic website of a topic of your choice. Web technologies to be used should include: HTML, JavaScript... ServletException, IOException{ response.setContentType("text/html
dynamic drop down list box - Java Beginners
a drop down box from an sql query in a servlet program, using only html & javascript. Is this possible without some kind of server side code? If so, please... inside a javascript file. if u use servlet there might be chance of loss
Getting content of alert message into textfield
); } } 2)If you want the code in html-javascript, then here is it: <...Getting content of alert message into textfield  how to get content of alert message into textfield using javascript   Getting content
Getting content of alert message into textfield
); } } 2)If you want the code in html-javascript, then here is it: <...Getting content of alert message into textfield  how to get content of alert message into textfield using javascript   Getting content
Traditional Means of Web Applica
to made requests through hidden frames which is inserted by html and JavaScript... pages were static, simple HTML web pages, later on it became dynamic by using CGI... be accessed by JavaScript. Another way is remote scripting which uses <src>
Question Answer
to programming technologies such as Java. .NET, C#, C, C++, HTML, JavaScript
Ajax Training Course
HTML JavaScript CSS... validation with Ajax Manipulate XML documents with JavaScript using the DOM... to Dom Rendering  Java to JavaScript Compilation 
Traditional Means of Web Application Development
frames which is inserted by html and JavaScript. This technique is much similar..., simple HTML web pages, later on it became dynamic by using CGI script (Perl..., again when server sent back data that is accessed by JavaScript.  Another way
Conditions In Java Script
the user's browser opens the HTML file. JavaScript is different from the Java language... in HTML within a <SCRIPT> tag. It can be used to any number of JavaScript... of JavaScript and create your first JavaScript program. About JavaScript Java
 

 

 

DMCA.com