Menu

How to add javascript onclick function

Help
lawnboles
2005-08-29
2012-10-09
  • lawnboles

    lawnboles - 2005-08-29

    Gday all - I have a question.
    My basic question (which may or may not have a basic answer) is:

    How do I make a link (to perform an action), in a specific display tag column, come up with a confirmation prompt before proceeding with the action? Before implementing displaytag, I used javascript, and manually made rows and columns via <td><tr>etc.... Specifically my line was:

    <a href="area.do?action2=delete&areaNumber=<c:out value='${ml.areaNumber}'/>" onclick="javascript:return(confirm('<fmt:message key='areaList.delete.msg'/>'));"><fmt:message key="areaList.delete" /></a>

    I heard that I need to modify the tlds... is that the way to go?

    Apologies for my 'newbie' terminology - I have just started using displaytags, and by the way, its absolutely fantastic.

    Any assistence in this matter will be very much appreciated.

     
    • lawnboles

      lawnboles - 2005-08-29

      Fixed!
      Don't worry people I've found a solution to my problem. it involves using my tableid "ID"

      <display:column><a href="area.do?action2=delete&areaNumber=<c:out value='${ID.areaNumber}'/>" onclick="javascript:return(confirm('<fmt:message key='areaList.delete.msg'/>'));"><fmt:message key="areaList.delete" /></a></display:column>

       
      • Jatin

        Jatin - 2007-01-10

        hey dude..
        I am not able to use the javascript function ie onclick attribute.
        I am getting error that.. Attribute onclick invalid for tag column according to TLD..
        Mine is display tag 1.1 .am i suppose to change the tld too ?

         
      • Claudia Mavilio

        Claudia Mavilio - 2006-04-05

        Did your export function work well?
        Thanks,

        Claudia

         

Log in to post a comment.