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



Home Answers Viewqa JavaScriptQuestions How to pass value of a link to a textfield

Have Programming Question? Ask it here!
 
 
 


dipanjan goswami
How to pass value of a link to a textfield
2 Answer(s)      3 years and 8 months ago
Posted in : JavaScript Questions


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.


Advertisement
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
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
PASS value
PASS value  javascript to pass value to other html file
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()">
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
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
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
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 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
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 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
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
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 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 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 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 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
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 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 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
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>
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 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
TextField on the Image
TextField on the Image  how we set label or textfield etc. on the Image
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
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 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
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 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
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, Try
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  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
[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
LINK
LINK  Thank you friend.cant we use single click instead of double click and also for four link u has given the example but i have 14 links in that case wat i should do
LINK
LINK  I have four links which link to a table,if i click one link... i want to ask is when i click 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
link
link  Hi Shruti Step1 :First thing you need to do is fetch the value from database and save it in a variable for ex. temp and put it in between a href tag as : Step2 : Use a id to select this using JavaScript or jQuery
How to put Focus on TextField - Design concepts & design patterns
How to put Focus on TextField  Dear Sir..... Once again, I am here for your help, Since, I am making a project, just for my own sake so that I can... on my TextField of the latter Window.... Hoping you can help me
how to pass a string from one class to another
how to pass a string from one class to another  hi all, Good morning. I am trying to develop a coding pass a string from one class and declare in other class. the string which i need to pass is the data from an file and i want
how to link differnt modules - Java Beginners
how to link differnt modules  i am doing my final year project which is based on steganography.we hide the secret msg in the spaces between the words... individually. the prob is how can i link all the 4 modules so that they work
how to give link from jsp to jsp page
how to give link from jsp to jsp page  hi this is my following code... file is Modify but here i have to give modifyUser.jsp file but i don't khow how exactly make a link with it   Jsp edit application 1)application.jsp
Advertisements
 

 

 

DMCA.com