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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

s:href and onclick , dealing with two different actions

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
    Bookmark Topic Watch Topic
  • New Topic