I need to display message when the user clicks link
How can I implement something where once the user click the hyper link on Page1, a "processing..." message and then as soon as Page2 is ready it forwards to Page2?
It is working for button click which I earlier posted got response implemented successfully.Thanks.
Hidden DOM element containing the message and to make it visible
Same thing I tried to implement for the below HTML code which is using Servlet not sure how to implement
<a href="<%=request.getContextPath()%>/servlet/VisibilityController?searchType=workSearchDetails&workNo=<%=installAtLocListBean.getWorkNumber()%>&ID=<%= firstLocationNumber %>&sitePosition=<%=pagePosition%>"><%=installAtLocListBean.getWorkNumber()%>onclick="MyFunction();return true;"</a></td>
Can any body help me is it possible to do as button click any examples please Thanks in advance
First, you have to block href call URL if don't want to open the tab/window or other operations. You can call a function in 2 ways using the href or onclick attribute in the HTML tag.
In JavaScript, you can call a function or snippet of JavaScript code through the HREF tag of a link. This can be useful because it means that the given JavaScript code is going to automatically run for someone clicking on the link. HREF refers to the “HREF” attribute within an A LINK tag (hyperlink in HTML).
Using onclick Event: The onclick event attribute works when the user click on the button. When mouse clicked on the button then the button acts like a link and redirect page into the given location. Using button tag inside <a> tag: This method create a button inside anchor tag.
The anwer is: not possible.
You can use either
<a href="javascript:someFunction()">LINK</a>
or
<a href="#" onclick="someFunction(); return false;">LINK</a>
or you can check this link. anchor tag onclick function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With