Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

s:href and onclick , dealing with two different actions  RSS feed

suresh midde
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using <s:a> tag with two actions.
I need to call javascript related action where i am submitting the form to a SaveAnswers action and later href related action in a sequence.

Right now, the method calls are happening not in sequence. i.e., in between the first method call , the second call is getting started.
So is there any way, that we can restrict the call order..

Btw, onclick or href which takes the precedence of invocation ?

<s:url id="url" action="getQuestionsForParticularPhase">
<s:param name="surveyId">
<s:property value="surveyTableVO.surveyId" />
<s:a href="%{url}" onclick="confirmsave();" ><s:property value="phaseDescription" />

function confirmsave(){
if(confirm('Do you want to save the answers ?')){

Suresh Midde
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!