mldardy Posted August 15, 2016 Share Posted August 15, 2016 Can someone assist me on how to do a mouse over on a hyperlink that shows what the user selected on the page they just left or saved. For example, the user clicks a link that says 'Add' and it opens a popup window where they select a list of items that have checkboxes, they check the items they want and then they click save to close the popup and they return to the original page. The user then hovers over another link that says 'Edit' and it shows them what they selected on the popup page. Can this be done and if so how? Link to comment Share on other sites More sharing options...
Ingolme Posted August 15, 2016 Share Posted August 15, 2016 Javascript can use the web storage API, but I would recommend doing it on the server-side, with a language like PHP. PHP has the $_SESSION system. Link to comment Share on other sites More sharing options...
mldardy Posted August 17, 2016 Author Share Posted August 17, 2016 I was able to get something but I get a "LabelHover() is undefined" error. Here is my code. What do I need to do to get rid of this error. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="NASA_LoD_Phase_1.WebForm3" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title><script language="javascript" type="text/javascript"> function LabelHover() { var text = "event"; document.getElementById("EditHyperLink").innerHTML = text; } </script> </title> <style type="text/css"> .auto-style1 { width: 100%; } .auto-style2 { text-align: left; } .auto-style4 { text-align: right; } </style> </head> <body> <form id="form1" runat="server"> <div> <table class="auto-style1"> <tr> <td class="auto-style2" colspan="2"> <asp:Label ID="lblProgram" runat="server" Text="Program:" style="text-align: left"></asp:Label> <asp:HyperLink ID="AddHyperLink" runat="server" NavigateUrl="javascript:var w=window.open('addprogramcode.aspx','','width=640,height=450');" CssClass="style19" ForeColor="#A90D39">Add Program Code</asp:HyperLink> <asp:HyperLink ID="EditHyperLink" onmouseover="LabelHover()" runat="server" NavigateUrl="javascript:var w=window.open('serviceset.aspx','','width=640,height=450');" CssClass="style19" ForeColor="#A90D39">Edit</asp:HyperLink> <asp:HyperLink ID="DeleteHyperLink" runat="server" NavigateUrl="javascript:var w=window.open('newdonors.aspx','','width=640,height=450');" CssClass="style19" ForeColor="#A90D39">Delete</asp:HyperLink> <br /> <asp:DropDownList ID="DropDownList1" runat="server" Width="400px"> </asp:DropDownList> </td> </tr> <tr> <td class="auto-style7"> <asp:Button ID="BackButton" runat="server" OnClick="Button2_Click" Text="Back" /> </td> <td class="auto-style4" rowspan="2"> <asp:Button ID="NextButton" runat="server" Text="Next" OnClick="SearchButton_Click" /> </td> </tr> </table> </div> </form> </body> </html> Link to comment Share on other sites More sharing options...
Ingolme Posted August 17, 2016 Share Posted August 17, 2016 You can't put a <script> tag in a <title> tag, and the Javascript should not be run on the server, it has to run on the client. Remove runat="server" from the HTML. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now