473,396 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to fill form by selecting clickable table values using java script

250 100+
I have table which is clickable.When user click one record I want to call java script function and fill the form using selected values. This is my code and I can't understand what is going wrong.Please help me..

Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2. function fillForm(){
  3.    document.getElementById('fullname').value=searchlist.getFullName();
  4. }
  5. </script>
  6. ....
  7. <input type="text" name="fullname">
  8. ....
  9.  out.println("<tr><td><a href='#' onclick='fillForm();'>" + searchlist.getFullName() + "</a></td>");
  10.  
  11.  
  12.  
  13.  
May 25 '10 #1
7 2843
Dormilich
8,658 Expert Mod 8TB
that’s not much to build upon … what is searchlist.getFullName()? is it defined? anything in the Error Console?
May 25 '10 #2
ghjk
250 100+
@ghjk
It is use to get database values. I didn't get any error when I click a record.
Expand|Select|Wrap|Line Numbers
  1. int i = 0;
  2. ArrayList searchList = (ArrayList) session.getAttribute("SearchList");
  3. if (searchList != null) {
  4.   ListIterator list = searchList.listIterator();
  5.   while (list.hasNext()) {
  6.     data.UserAccount searchlist = (data.UserAccount) list.next();
  7.     out.println("<tr><td><a href='#' onclick='fillForm();'>" + searchlist.getFullName() + "</a></td>");
  8.  
May 26 '10 #3
RamananKalirajan
608 512MB
Have a look over this

Thanks and Regards
Ramanan Kalirajan
May 26 '10 #4
Dormilich
8,658 Expert Mod 8TB
from what I can see you try to intertwine 2 programming languages. are you sure you have called each one correctly?
May 26 '10 #5
ghjk
250 100+
@RamananKalirajan
RamananKalirajan
Exactly I want to do this? Please help me..
May 26 '10 #6
RamananKalirajan
608 512MB
You can have the code for that in this link. But this one is a static one i developed. Use this as a sample and try it out. we will help you out, if you are struck up.

Thanks and Regards
Ramanan Kalirajan
May 26 '10 #7
ghjk
250 100+
@ghjk
You have to pass the values like this and. get them from java script
Expand|Select|Wrap|Line Numbers
  1. out.println("<tr><td><a href='#' onclick=\"javascript:editForm(\'"+full_name+"\',\'"+user_type+"\');return 0;\"></a></td>");
  2.  
  3.  
Expand|Select|Wrap|Line Numbers
  1. function editForm(fullname,usertype){
  2. ......
  3. .......  
  4.  
Jun 28 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Alen Hubtka | last post by:
Hello All, Can any one share the code to compare two date data using Java script?Please. I would like to compare two dates and findout there are greater than or less than each other. Thanks,...
3
by: Srinu | last post by:
How do i hide status bar in firefox using java script only Plz help me iam new to this group.
6
by: abdullah1983 | last post by:
Hi Guys, I need some clarification regarding the problem with safari browser. Please find my code below. I'm setting the image src, mouseover and mouseout using javascript. The mouseover and...
8
by: dbaplusplus | last post by:
I worked on web development using java script many many years, so I am now a newbie to javascript. I have a single html page, which is generated dynamically using some programming language. Web...
4
by: gsuns82 | last post by:
hi friends,can any one give the coding for finding file size using java script???
1
by: harshavardhan | last post by:
Hi, here is the problem: Consider there are three frames in a HTML page. When I try to print these frames using java script, only the third document is being printed thrice. <HTML><HEAD> <script...
7
by: kamalaswaminathan | last post by:
Hi all, I want to pass the value of the select box to another form using java script. my code looks like this.. <script> function func { document.myform.action = "abc.cgi";...
3
by: mail2pragati | last post by:
Hellp all, I want to generate the alpha numeric numbers (like : A-0001/0708,S-0010/0708) as soon as the form is loaded. Is it possible using Java Script. And then these generated numbers are stored...
6
by: DhananjayPatki | last post by:
Hello, I wnat the code , how to disable the Close(x) icon script using java script . is there any event that can be used to prompt the user before closing the new window.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.