guest
onclick pass variable
1 Answer(s)      4 years and 10 months ago
Posted in : JSP-Servlet
on button onclick event pass variable and print in textbox in same page... i want to pass value of variable at onclick event of button and also want to print it in textbox in same page....
Advertisement
View Answers

August 20, 2010 at 10:39 AM


Hi Friend,

Try the following code:

<html>
<script>
function passVariable(){
var v=document.form.txt.value;
document.form.txt1.value=v;

}
</script>
<form name="form">
Enter String:<input type="text" name="txt"><br>
<input type="button" value="Send" onclick="passVariable();"><br>
<input type="text" name="txt1"><br>
</form>
</html>

Thanks









Related Tutorials/Questions & Answers:
onclick pass variable - JSP-Servlet
onclick pass variable  on button onclick event pass variable and print in textbox in same page... i want to pass value of variable at onclick event of button and also want to print it in textbox in same page....  Hi
you pass a variable by value.
you pass a variable by value.  How do you pass a variable by value... $a = &$b /*--------------Pass By value----------------*/ function add($a) { return ++$a; } add($a); /*---------------Pass by reference
Advertisements
How do you pass a variable by value?
How do you pass a variable by value?  How do you pass a variable by value
How to pass javascript variable in Scriplet of JSP?
How to pass javascript variable in Scriplet of JSP?  How can I assign the value of a javascript variable to a variable declared in jsp scriplet? Is it possible
how to value of one variable pass in other variable in revetse order
how to value of one variable pass in other variable in revetse order  Like variable a=367 b must have valuev763
how to pass class variable to another class
how to pass class variable to another class  i need to access a variable from a class to another class currently running at the same time. using Classname.variable i got the value. But when i change the value second time i got
How to pass variable from one class to another in java
How to pass variable from one class to another in java  How to pass variable from one class to another in java?   Example: public class... and variable through by calling Class1 getter methods
pass a variable(friends name) through a hyperlink in to another jsp.
pass a variable(friends name) through a hyperlink in to another jsp.  hi friends, i am developing a site in jsp. i have some problem,plz tell me... in to the next page,but i want to pass a specific friend name which i was clicked,plz tell
pass a variable(friends name) through a hyperlink in to another jsp.
pass a variable(friends name) through a hyperlink in to another jsp.  hi friends, i am developing a site in jsp. i have some problem,plz tell me... page,but i want to pass a specific friend name which i was clicked,plz tell me
How many ways we can pass the variable through the navigation between the pages?
How many ways we can pass the variable through the navigation between the pages?  How many ways we can pass the variable through the navigation between the pages
how to pass variable from simple java main class(not servlet) to the jsp page?
how to pass variable from simple java main class(not servlet) to the jsp page?  I have a simple Java class in which I invoke a call to a JSP page, by launching a browser. I have this part working, but now I want to pass variables
JSP Variable in Javascript
you to pass jsp variable to javascript. The JavaScript include a function... are going to pass the jsp variable to javascript. You can see in the given example... JSP Variable in Javascript   
javascript onclick function
javascript onclick function  javascript onclick function   <html> <head> <script language="javascript"> function...!" onclick="showmessage()" > </form> </body> </html>
jquery href onclick event
jquery href onclick event  jquery href onclick event   $('a').click(function (event) { event.preventDefault(); //here you can also do all sort of things });   <script type="text/javascript
calling setInterval() on onclick event
calling setInterval() on onclick event  Hi all, I am trying to call setInterval() on onclick event. But it is executing the code only once...(a+"=: "+a); } </script> <body> <div id="one" onClick="send();">
onClick not working - Java Beginners
onClick not working  The project is to create a pizza ordering form. On the summary page, I am trying to get a confirmation to popup when the submit pizza order button is clicked. I have it linked to a function
Passing variable
Passing variable  How to pass variable to HTTP object in HTMl or PHP
PASS value
PASS value  javascript to pass value to other html file
PHP Variable Functions
PHP Variable Functions: Learn PHP Variable Function means that if a variable name has a format like this $var(), PHP will consider this as a variable function... to execute it. This variable function does not work with echo(), print(), unset
Option onclick am not getting the value ..
Option onclick am not getting the value ..    function get_val( tot_val ) { document.getElementById('TextBox1').value = tot_val; } <tr> <td><textarea id="TextBox1" name=textarea1 readonly="readonly
environment variable
environment variable  what is environment variable in java?   Environment variables are used by the Operating System to pass configuration information to applications
Pass by Reference - Java Beginners
Pass by Reference  Hi Friends, What is Pass by value and Pass by Reference?can u please explain with examples.is java supports Pass by reference?  Hi Friend, Pass By Value: It refers to pass the variables
Can I pass a
Can I pass a   Suppose I have servlet named Name.java and there is a variable String name holding a value "Roseindia". I have collected the value to Getname.jsp via ajax. Now how can I pass this value to scriplet without page
commandlink tag in primefaces needs onclick effect
commandlink tag in primefaces needs onclick effect   I wanted this png link to have onclick effect like when
Local Variable and Instant Variable
Local Variable and Instant Variable  difference between Local Variable and Instant Variable   Difference between local variable and instance variable Instance variable is declared within a class but not within
HTML Button onclick get ID of Button
HTML Button onclick get ID of Button  How i can get the ID of HTML Button on click?? I wanted to do it using JavaScript function. Thanks
objective c pass by value
objective c pass by value   How to pass value by reference...:(NSInteger)j { //j == 0! but j is a copied variable. It is _NOT_ i j = 23... to be able to modify i, you would have to pass the value of the reference by doing
Is Java pass-by-reference?
Is Java pass-by-reference?  Is Java pass-by-reference
pass method reference in java
pass method reference in java  How to pass method reference in Java
JavaScript pass arguments
JavaScript pass arguments   How to pass dynamic arguments to the functions in JavaScript
PHP Pass Post Data
PHP Pass Post Data  How to pass POST data to the PHP-CGI