aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes assign a function to the anchor via javascript. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "assign a function to the anchor via javascript." Watch "assign a function to the anchor via javascript." New topic
Author

assign a function to the anchor via javascript.

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi guys.
as u see from the code below; i have some problems
1-i 'd like to assign a function to the anchor via javascript. I read that void( 0 ) would do that. it works, but then onClick-event handler doesnot. It cannot submit the form.
2-the gif image cannot be rendered. Although the relative path is absolutely true.
3-is window.document.forms-i notation not correct, bcos IE gives object null error.
regards....

td
a href="javascript:void(0);"
on-Click = "check_and_submit_form(t his);" &st;
img src="../images/wwr3DGrau_MA2_oben.gif"
alt="being loaded.Sei Geduldig !!!"
align="left" height="95" width="112"
a
td
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
<td>
< a href="javascript:void(0);">
onClick = "check_and_submit_form(this);"
<img src="../images/wwr3DGrau_MA2_oben.gif"
alt="being loaded.Sei Geduldig !!!"
align="left" height="95" width="112">
</a>
</td>
Try this way
<td>
< a href="javascript:check_and_submit_form(this);"><img src="../images/wwr3DGrau_MA2_oben.gif"
alt="being loaded.Sei Geduldig !!!"
align="left" height="95" width="112">
</a>
</td>
Eric
sunitha reghu
Ranch Hand

Joined: Dec 12, 2002
Posts: 937
Try this way also

<a href="javascript:void(document.check_and_submit.submit(this))"><img border="0" src="" > </a>
[ May 08, 2003: Message edited by: sunitha raghu ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: assign a function to the anchor via javascript.
 
Similar Threads
new tbody content
Multiple Select box Problem
Help me to have a sortable table in my html profile!
On mouse over / On click events
Table with Scrollbar