Html / Java Script

Html / Java Script

Hi There,
in my form there are ten text boxes. my requirement is that when i click checkbox,the values of first five textbox has to copy to next five.
I need jscript for that
View Answers

April 1, 2010 at 2:53 PM

Hi Friend,

Try the following code:

<script>
function convertField(){
if (document.form.check.checked){
var d1=document.form.text1.value;
document.form.text6.value=d1;
var d2=document.form.text2.value;
document.form.text7.value=d2;
var d3=document.form.text3.value;
document.form.text8.value=d3;
var d4=document.form.text4.value;
document.form.text9.value=d4;
var d5=document.form.text5.value;
document.form.text10.value=d5;

}
}
</script>
<form name="form">
<table>
<tr><td>TextField 1</td><td><input type="text" name="text1"></td></tr>
<tr><td>TextField 2</td><td><input type="text" name="text2"></td></tr>
<tr><td>TextField 3</td><td><input type="text" name="text3"></td></tr>
<tr><td>TextField 4</td><td><input type="text" name="text4"></td></tr>
<tr><td>TextField 5</td><td><input type="text" name="text5"></td></tr>
<tr><td>TextField 6</td><td><input type="text" name="text6"></td></tr>
<tr><td>TextField 7</td><td><input type="text" name="text7"></td></tr>
<tr><td>TextField 8</td><td><input type="text" name="text8"></td></tr>
<tr><td>TextField 9</td><td><input type="text" name="text9"></td></tr>
<tr><td>TextField 10</td><td><input type="text" name="text10"></td></tr>
<tr><td><input type="checkbox" name="check" onClick="convertField();" ></td></tr>
</table>
</form>

Thanks









Related Tutorials/Questions & Answers:
Html / Java Script - Development process
Html / Java Script  Hi There, in my form there are ten text boxes. my requirement is that when i click checkbox,the values of first five textbox has to copy to next five. I need jscript for that  Hi Friend, Try
Example program to pass value from Html to java script
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...() in our example html page it pass it to the java script of the page
Advertisements
please send me java script for html validation - Java Beginners
please send me java script for html validation  please send me code for javascript validation .........please send me its urgent a.first:link { color: green;text-decoration:none; } a.first:visited{color:green;text
Java Script
Java Script  What is Java Script? How to learn Java Script?   Hi Java Script is client side programming language. It runs on browser.... You can learn Java Script from our JavaScript - JavaScript Tutorial pages
Java script
Java script  Source code for capturing the screen using Java Script
Java Script
Java Script  why we are using java script
Java Script
Java Script  Hi, Any one please share a code to swap the 2strings using java script
java script
java script  how to write a Java script program to enter number in two text fields and then automatically display the total in another text field
Java script
Java script  a java script code for accept 10 numbers from the user and print in the descending order without using sort method
java script
java script  Hi, Any one please tell me how, to store below elements in an array using java script 12,13,14,a,b,xyz
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script
Java Script  Hello Sir, Is it possible to select only current date from datetimepicker in struts2 through java script validation. Means when i select.... Try to send me java script validation code for this purpose that user won't
Java Script.
Java Script.  The below code is nit working in Google chrome can any one tell me the solution as soon as possible. <script type="text/javascript"> <!-- function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi i want to submit two form using javascript.The below code submitting two forms in server but its not working in browser like chrome and firefox am struggling for many days give me solution as soon as possible
java script
java script  how will you identify whether the number entered by the user has two digits or three digits.Assuming that the user enters only a three digit or two digit number.   <HTML> <HEAD> <SCRIPT
java script
java script  write a java script code which provide a menu for user which will enable him/her to either add or subtract or multiply or divide two numbers and produce the corresponding result.   <html> <
java script
java script  when you click a button how will you change the background color of a web page
java script
java script  I want to display set of radio buttons after i select one option of the combobox
java script
java script  what is the use of getElementById() method in jsp. and give me its full knowledge with a example
java script
java script  hi deepak, i have small doubt in the date ranges that when i select the date range then it display on the text boxes. example:suppose i select the weekly date range then the dates are display on the text boxes up
Java Script
Java Script  I want to display an error message for the validation of email at the top of the page in red font i want to use java scripts but i dont want to use alert box what i need to do   <html> <script>
java script - Development process
java script  hi.. how to get previous and next buttons inside the table in the same page as like our mails in the inbox.  Hi Friend, Try the following code: ID Name Address Contact
Java Script location.replace method
Java Script location.replace method  Hi, What does `Print `{<SCRIPT LANGUAGE="JavaScript"> location.replace("} & urlpop & {","BOTTOM") </SCRIPT>} this mean as this is written in an Lotus Script agent and I
defining numbers in Java Script
defining numbers in Java Script  Explain about defining numbers in Java Script
Java script in servlet
Java script in servlet  Hi. How to use javascript inside java servlet? Thanks in advance
java script - JSP-Interview Questions
java script  i want that my registration page shud be get poped up when i will clik a on a link on my login page....how can i do it using java script or i shuld use html
Java Script Program
Java Script Program  <%-- Document : index Created... contentType="text/html" pageEncoding="UTF-8"%> JSP Page... are available in the Sun Java System Application Server 9.1 logs. Sun Java System
Java Script Program
Java Script Program  <%-- Document : index Created... contentType="text/html" pageEncoding="UTF-8"%> JSP Page... are available in the Sun Java System Application Server 9.1 logs. Sun Java System
form to java script conversion
form to java script conversion  I am using a form one more form cotain a piece of code . how to convert it to java script to function it properly..." name="ie" value="UTF-8" /> <input type="text" name="q" size="55" />
java script - JSP-Servlet
java script add items  How to add items in an array in JavaScript?  Hi friend,<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01... in javascript</title><script type="text/javascript" src="mtmcode.js
java script - Development process
java script  how could i devlop code for create widget. i need to generate java script that if paste to any other web site will generate the widget. a widget can contain image text video or combination
qunit jquery with java script
qunit jquery with java script  hi deepak How to write a javascript code and do the test by using qunit sample application and as I am new to testing how to setup the environment for java script testing? where should I run
java script - Ajax
java script  i know basic of java script. i want to gain more knowledge in java script. please send a link or guidelines to me. and ajax also my mail address is [email protected]  Hi friend, Javascript
stuts java script validation is not working.
stuts java script validation is not working.  hello my stuts client... and validation.xml file's code. pls help --of jsp page-- > <html:form action...; <html:javascript formName="logonForm"/> > Enter
script error - Java Beginners
script error  hi, Is it possiple to use PHP function under the script tag. plz help me. thank u in advance. regards, sakthi  Hi Friend, Yes It is possible to use PHP function under the script Tag. Thanks
java script - Ajax
java script  I have a java script function and getting "pitems" list values in select, and i want to send the values in the form of List to my CommonService class. Below code is not working... function f_getPop
Java script - Development process
Java script  Dear Sir/Mdm I have a probem, when any user close the browser without logout at that moment the user should be logout, I wrote some java script code for that its working in IE not Fire Fox, actually
Java Script Help
Java Script Help  I have written a countdown timer using javascript... help --- <html> <head> </head> <script language....' window.location = 'crdtd.php?q=b
java with html
java with html  actually we use html code in the java programs........ why we are using like please tell me the reason.. please reply me soon
script problem - Java Beginners
script problem  Even though both .js file and .jsp file present in the same location,script is not working in mozilla but working in Internet... what i have written present in same location. but the script
java html
java html  program for jsp    --Select...-Type" content="text/html; charset=UTF-8"> <title>JSP Page<..." /> <script lang="javascript"> function search
java script - Ajax
java script  I have a java script function and getting "pitems" list values in select, and i want to send the values in the form of List to my CommonService class. I want to display the selected value from the select box
java script - JSP-Servlet
java script  what is the use of hidden fields in java script? if a page has 3 links the first link should be enabled and others should be disabled. once the form inside the first link is filled and submitted the next link should
Progress Bar implementation in Java Script
Progress Bar implementation in Java Script  Hi Friend, I am new to Java Script, but i want implement the progress bar in my html by reading the value from file (like value=30) and the value in file be changing from 0 to 100
stuts java script validation is not working.
stuts java script validation is not working.  hello my stuts client...-- Enter name: Enter pass: <html:submit/> </html:form> --of validation.xml-- <form name
stuts java script validation is not working.
stuts java script validation is not working.  --of jsp page-- Enter name: Enter pass: <html:submit/> --of validation.xml-- <form name="logonForm"> <
stuts java script validation is not working.
stuts java script validation is not working.  --of jsp page-- Enter name: Enter pass: <html:submit/> --of validation.xml-- <form name="logonForm"> <

Ads