How to use the two link in one onclick

<a href="baktha.doc" onClick="call javascript function"/>

at the time of click to call both href and onclick,

please help is't possible or not in simple jsp otherwise how to use struts jsp tages anything else
<a href="baktha.doc" onClick="call javascript function"/>

Open in new window

Sachin_AjmaniAsked:
Who is Participating?
 
Sathish David Kumar NConnect With a Mentor ArchitectCommented:
onClick="javascript :function1();function2()"/>
0
 
Sachin_AjmaniAuthor Commented:
<a href="baktha.doc" onClick="call javascript function"/>
0
 
ramkihardyCommented:
simple you can do like this....
make one href as invisible and one as visible place the two hrefs one above the other...if a user click
both the hrefs are clicked......
 <a href="baktha.doc" onClick="call javascript function"/>
 <a href="xyz.doc" onClick="call javascript function"/>
otherwise u can use like this
 <a href="baktha.doc" onClick="javascript function"/>
within the javascript function...call both the javascript function you want to call...this might solve your problem...

Let me know if u want any help...
Regards
Ramki
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
BardobraveCommented:
Usually the best approach for these situations is to fire both commands from within javascript. Get rid of A tag's href (or pass it as a parameter to javascript function if it's needed) and launch the link after completing javascript call.
0
 
Gurvinder Pal SinghCommented:
looks like you want to open a document and also call a javascript function,

You can do both using javascript, so you don't need a href attribute

<a href="#" onClick="function1('baktha.doc')"/>

function function1(url)
{
   window.open(url);
   //call other javascript function
}
0
 
Maverick_CoolCommented:
the onclick function should return true, then only href will work.
0
 
khan_webguruCommented:
Hello Bro!

If you want that after client side click function href=""  should also be work then you have to write the code like this:

 
<a href="baktha.doc" onClick="testFuncation();return true;"/>

Open in new window



I am assuming that your function name is "testFunction();"  after this just add "return true;". You can do this in you funcation as well rather then write in <a> tag like this:

 
<a href="baktha.doc" onClick="testFuncation();return true;"/>

Open in new window



hope this will solve your problem.

Regards,

Asif Ahmed Khan
function testFunction()
{
   // your code logic


   //then return true
   return true;

}

Open in new window

0
 
khan_webguruCommented:
any success???
0
 
Maverick_CoolCommented:
why is the question being closed? Provide proper reason.
0
 
Sathish David Kumar NArchitectCommented:
User didnt tell the correct reason to close the question
0
 
Sathish David Kumar NArchitectCommented:
i mention correct solution http://#35179372
0
 
Maverick_CoolCommented:
I had given correct direct in POST ID: 35179418
0
 
WallyModCommented:
In the abscence of the authors response anywhere in the thread, the recommendation is to accept the post by dravidnsr in http:Q_26900087.html#a35179372 as this is the first explicit entry relating to calling two functions in the one click.

WallyMod
Community Support Moderator
0
All Courses

From novice to tech pro — start learning today.