Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

s:href and onclick , dealing with two different actions

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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:param>
</s:url>
<s:a href="%{url}" onclick="confirmsave();" ><s:property value="phaseDescription" />
</s:a>

function confirmsave(){
if(frm_questionnaire.answerChanged.value=="true"){
if(confirm('Do you want to save the answers ?')){
frm_questionnaire.action="saveAnswers.action";
frm_questionnaire.submit();
}
}
}

Regards
Suresh Midde
    Bookmark Topic Watch Topic
  • New Topic