473,395 Members | 1,870 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,395 software developers and data experts.

javascript (hyperlink)

2
how to give a hyperlink to view in the following code


Expand|Select|Wrap|Line Numbers
  1. <script language="javascript" type="text/javascript">
  2.  
  3. function addtoGrid(){
  4. alert("working");
  5.  
  6. var txt1=document.awards.m_date_dateOfAchievement.value;
  7.  
  8. var ta1=document.awards.m_str_awardDetails.value;
  9. var ta2=document.awards.m_str_remarks.value;
  10.  
  11. var tbl = document.getElementById('tbl');
  12. var lastRow = tbl.rows.length;
  13.  
  14. var row = tbl.insertRow(lastRow);
  15. row.setAttribute('onclick',function(){
  16. alert("working");
  17. document.awards.m_date_dateOfAchievement.value=txt1;
  18. document.awards.m_str_awardDetails.value=ta1;
  19. document.awards.m_str_remarks.value=ta2;
  20.  
  21. alert(this.rowIndex);
  22.  
  23. tbl.deleteRow(this.rowIndex);});
  24.  
  25. var cellLeft1 = row.insertCell(0);
  26. cellLeft1.innerHTML=txt1;
  27. var cellLeft2 = row.insertCell(1);
  28. cellLeft2.innerHTML=ta1;
  29. var cellLeft3 = row.insertCell(2);
  30. cellLeft3.innerHTML=ta2;
  31. var cellLeft4 = row.insertCell(3);
  32. cellLeft4.innerHTML="view";    //how 2 provide the link here this a dynamically genereted table all the cells are filled in from the form controls except for view which is a fixed value displayed in every row.when we click on this it should go 2  a particular file where the data is.
  33. document.awards.m_date_dateOfAchievement.value="";
  34. document.awards.m_str_awardDetails.value="";
  35. document.awards.m_str_remarks.value="";
  36. }
  37.  
  38. </script>
please give the code
Dec 19 '07 #1
1 1534
if i have understood what you are asking is it not just a case of adding the required html <a> tags to the string "view" and so you have
Expand|Select|Wrap|Line Numbers
  1. "<a href='http://www.thescripts.com'>view</a>"
or does each one need a different url to load depending on which cell it is in?

Chris
Dec 19 '07 #2

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

Similar topics

6
by: domtam | last post by:
First of all, my ASP.NET application has to support browser with Javascript disabled. In the application There is a control that looks like a text hyperlink, but the server-side has to do...
3
by: Shapper | last post by:
Hello, I am working on an ASP.NET/VB web site. I have several links including menu links. Considerer a want to load a page named page.aspx. I can do it using javascript. Or using this code:...
4
by: Matt Jensen | last post by:
Howdy all Hopefully I can explain my problem straightforwardly. In it's simplest explanation, what I want to do is have a hyperlink that, when clicked, executes some client side JavaScript and...
12
by: Joe | last post by:
Hello All: I'm sure that one of you can quickly spot the error in my script. I am using a small javascript function to retrieve the text of a hyperlink in a datagrid column. Here is my...
1
by: KRISHNA PRAVI | last post by:
the error is "runtime error object expected" here is the code....................................................................................... <script language="javascript"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.