How to pass value of a link to a textfield

How to pass value of a link to a textfield

Dear Sir, in my project I'm initially making a value of the textfield as a link. Now, I want to pass the value of the link in the textfield after clicking the link and dont want to open a new page. Please reply ASAP.

View Answers

November 27, 2010 at 11:37 AM

hi Friend,

Try the following code:

<html>
<script>
function fun(s) {
document.getElementById("msg").value=s;
}
</script>
<a href="#" class="leftlinks" onclick="fun('Hello')" id="ide" >CLICK HERE</a>
<input type="text" id="msg" >
</html>

Thanks


November 27, 2010 at 11:38 AM

hi Friend,

Try the following code:

<html>
<script>
function fun(s) {
document.getElementById("msg").value=s;
}
</script>
<a href="#" class="leftlinks" onclick="fun('Hello')" id="ide" >CLICK HERE</a>
<input type="text" id="msg" >
</html>

Thanks









Related Tutorials/Questions & Answers:
How to pass value of a link to a textfield
How to pass value of a link to a textfield  Dear Sir, in my project I'm initially making a value of the textfield as a link. Now, I want to pass the value of the link in the textfield after clicking the link and dont want to open
how to set the value of textfield constant
how to set the value of textfield constant  how to set the value of textfield constant
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
PASS value
PASS value  javascript to pass value to other html file
In Struts 2 how to pass the <s: property value=''
In Struts 2 how to pass the s: property value'  In Struts 2 how to pass the s: property value' I have page where i display the list of treasury... this data.jsp from that DB and display the same in a page. How do i send
How to pass value from dijit.Tree to dijit.MenuItem - Ajax
How to pass value from dijit.Tree to dijit.MenuItem  Hi Friends, I... with the menu. But I want to pass the value of an item to its menu item and when user will clik on that menu, the value should be shown like Delete Instead
How to pass the value from controller to jsp page ?
How to pass the value from controller to jsp page ?  HI I need to pass the value from controller to jsp. I use the way like this Controller request.setAttribute("msg", "Successfully Login"); In jsp ${msg} and then i
How to pass the value of Selected Value of combo box into sql ??
How to pass the value of Selected Value of combo box into sql ??  My SQL Database Name is MHS, user=root, password=admin,table name is sub_comb... submit i want to display other field. how to get it?? plz help me
get textfield value in javascript
get textfield value in javascript  How to get and the set value of text field in JavaScript?   Get the text field value in JavaScript <..."> <input type="button" value="Convert" onclick="convertText()">
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
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
objective c pass by value
objective c pass by value   How to pass value by reference...; //j now == 23, but this hasn't changed the value of i. } If you wanted to be able to modify i, you would have to pass the value of the reference by doing
pass by value /reference - Java Beginners
pass by value /reference  hello sir/mam, i know pass by value is a primitive type in java. what about pass by reference in java ? .. For object type pass by value is used or pass by reference is used ? pls give me a example
Java Pass Value Example
Java Pass Value Example       Pass value from JSP to JavaScript We can also pass the value from a JSP page to the java script as we have done in our
i want to pass Javascript value to JSP scriptlet..
i want to pass Javascript value to JSP scriptlet..  i am having... that i am calling the onchange function. In javascript i am getting the value now i want to pass this value to JSP scriptlet
please tell anybody how can i set a value in hiperlink for edit n delete link
please tell anybody how can i set a value in hiperlink for edit n delete...; <td><html:link href="viewServlet?user=">Edit</html:link> <html:link onclick="return confirmSubmit()" href="deleteServlet?tid
how to move pointer in Textfield to newline
how to move pointer in Textfield to newline  consider my case...; class Table1 extends Frame implements ActionListener{ TextField tf1,tf2,tf3...(100,10,200,30); Label l2=new Label("Enter the value to get its Table
how to set size of button,textfield.
how to set size of button,textfield.  how we set size of button textfield etc and reduce problem when click maximize button the text or textfield get large how to set as a preferd size in the panel or frame .when we click
How to Type in japanese in java Textfield?
How to Type in japanese in java Textfield?  Hello Sir/madam; Am... in textfield ..Please help me and tell me how to write in japanese... user.User needs to type in japanese in the textField.but I dont know how to type
write a program to demonstrate call by value and call by reference.(pass objects as parameters)
write a program to demonstrate call by value and call by reference.(pass objects as parameters)  write a program to demonstrate call by value and call by reference.(pass objects as parameters
how to pass the parameter in callable statement
how to pass the parameter in callable statement  calstat=conn.prepareCall("{call studentrc(?,?,?,?,?)}"); // it show error parameter value is null...=smark1,mark2=smark2,total=stotal where Regno=Regno; end;// how can i pass the parameter
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 can u reduce the size of textfield?
how can u reduce the size of textfield?  how can u reduce the size of textfield? thanks in advance   import javax.swing.*; public class ReduceTextField extends JFrame { public static void main(String
How to pass multiple values from a servlet to JSP?
How to pass multiple values from a servlet to JSP?  hi, I want to pass multiple values form a servlet to JSP. Hw do i do that? I am able to send one value at a time without any prb, but I am unable to carry multiple (from two
Pass value from JSP to JavaScript
Pass value from JSP to JavaScript       We can also pass the value from a JSP page to the java... a function hello() which takes value from the jsp page on click of some button
How can i pass the valus from a JSP to the action class???
How can i pass the valus from a JSP to the action class???  hewllo wevryone... can anyone help me with how i can pass the value of menuId in my JSP and pass it in the action class
TextField on the Image
TextField on the Image  how we set label or textfield etc. on the Image
Get JTextField value from another class
Get JTextField value from another class       In this section, you will learn how to get the textfield value from other class. For this, we have created two classes ClassA.java
how to pass command line arguments in ant
how to pass command line arguments in ant  How to pass runtime values ie commandline arguments to a program written in java using ant tool
how to create password reset link
how to create password reset link  how to create password reset link in jsp also which is expire specific time of period and also access on time that link
how to retrieve link - JSP-Servlet
how to retrieve link  how to retrieve link of a web page and use it as input in the program
how to pass class variable to another class
how to pass class variable to another class  i need to access... Classname.variable i got the value. But when i change the value second time i got the previous value. I used static variabe.   Hi Friend,ADS
How to pass query as parameter? - JSP-Servlet
How to pass query as parameter?  Hi Friends, I have a real tough... not able to pass the value of qry1,qry2,qry3... Please help me to find the solution..."; String qry3="select age from table13"; string q=Insert into emp values
How to display button as a link in vaadin?
How to display button as a link in vaadin?  Hello, I am working on a Vaadin based web application. I want the button to be displayed like link... a button. How to achieve this? Thanks   Hi, You can use the following code
Pass value from child to parent window
Pass value from child to parent window       Java example program to pass value from child window... the parent window and will take the value to pass it on to the parent window
how to enable textfield in j2me netbeans when a choice element is selected?
how to enable textfield in j2me netbeans when a choice element is selected?  How to enable a textfield in j2me using netbeans when a choice element is selected and how to keep it disabled when any choice element corresponding
how to enable textfield in j2me netbeans when a choice element is selected?
how to enable textfield in j2me netbeans when a choice element is selected?  How to enable a textfield in j2me using netbeans when a choice element is selected and how to keep it disabled when any choice element corresponding
How to create Link in SWT
How to create Link in SWT       In this section, you will study how to create Link in a text. SWT allows to create link by using the class Link of package
how many max. arguments we pass to the any function ? how many max. arguments we pass to the any function ?
how many max. arguments we pass to the any function ? how many max. arguments we pass to the any function ?   how many max. arguments we pass to the any function
link
link  hey frnds can anyone plz tell me how can i store my videos as link in my database and can retrive the video using servlet by clicking on to that link .it may be confusing sorry about that and if someone can than plz help me
How to pass an arraylist from servlet to jsp?
How to pass an arraylist from servlet to jsp?  Hello, Can anyone please tell me how to pass an arraylist from servlet to jsp? I have two arraylist one of type String and the other int. How to send both the arraylists from
[JSP] How to pass back ID to previous page.
[JSP] How to pass back ID to previous page.  Hi experts, May I ask something. How to link a page to previous page which the content in previous page is selected from database where IDPRODUCT=". I don't know how to pass back
How to add nofollow in website link?
How to add nofollow in website link?  Hi, I want to add nofollow in my outgoing links. What is the code? Thanks   Hi, Here is the code: <a rel="nofollow" href="http://">Click Here to visit</a>
How to pass command line arguments in Java?
How to pass command line arguments in Java?  Hi, In a Java program I have to write for reading the command line arguments and use it in a programming. How to pass command line arguments in Java? Share me the sample code
How to Pass data from jTextField1 in jFrame1 to jLabel1 in jFrame2
How to Pass data from jTextField1 in jFrame1 to jLabel1 in jFrame2  I have a Form login_pass (jFrame) which has a jTextField1 to take input (employee id) from the user. I want that the value of employee id given by user
how to set value of dropdown list
how to set value of dropdown list  Hello Sir, I'd solved the earlier problems somehow but now this time another problem arised when I want to pass the value from a link to a dropdown list. I want to set the dropdown list selected
how to set value of dropdown list
how to set value of dropdown list  Hello Sir, I'd solved the earlier problems somehow but now this time another problem arised when I want to pass the value from a link to a dropdown list. I want to set the dropdown list selected
link
link  how can we give hyperlinks on data retrieved from the database and when a particular option is clicked it should be saved in another database and details related to that link should be diaplay and stored in the database
link
the link the table is displayed and other links were hidden if i want to click the next link i have to refresh the page instead i want to do is when i click the link the table should display and again when i click the link the table should
TextField validations
TextField validations  I want to know How to check first letter capital or not in a text field and also check all are characters or not in same textfield? and also want to know how to check all digits or not in a textfield? ex

Ads