The moose likes HTML, CSS and JavaScript and the fly likes Anchor tag calling Javascript function Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Anchor tag calling Javascript function" Watch "Anchor tag calling Javascript function" New topic
Author

Anchor tag calling Javascript function

carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

Hi I am calling a javascrit function from anchor tag ... my problem is whatever the function return back anchor tag transfer the control to a new window, but i dont want this to hapen .... the jsp containing anchor tag has form fields and i am doing the validations of these form fields by calling a function present in javascript on clicking anchor tag.




here when any of the radio button is not selected the function returns false and the anchor tag display false as output in the window.. which i dont want ... Can anybody suggest me how do i make the anchor tag behave like a button.....

Also here i am using anchor tag because instead of using normal html buttons i created a fancy button using anchor tag. and now i need to use anchor tags evrywhere to invoke javascript functions.
>
carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

simple got it just need to add onClick instead of HREF
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Anchor tag calling Javascript function
 
Similar Threads
selectOneRadio - javascript get value
I keep getting on Javascript Error on the bottom left of IE
Can you read this?
jQuery not working on page
Page section does not update after call of a4j:support in IE 9