Hello,

I'm relatively new to all this and  have been having a problem recently.
I've got a list of items on a users homepage that has a delete link next
to it. When they click on that they get a javascript confirm dialog asking
them if they really want to go ahead.

In the jsp file I've got:

function deleteMaterialFromList(materialId) {
        var agree = false;
        agree = confirm('Something intellagent...');
        if(agree) {
          document.write("<jsp:forward
page=\"/project/remove.do?material=\""+materialId+"\" />");
        }
        else {
          document.write("<jsp:forward
page=\"/project/prepareUserHomePage.do\" />");
        }
}

and later:

<a class="delete" href="#" onMouseOver="status='Remove this material';
return true;"
  onmouseout="status=''; return true;"
  onclick="deleteMaterialFromList('<%=mat.getName()%>');">X</a>

But all it does is display a page of text with that one line on it. I was
expecting it to forward to the action and produce the relevant page.

Anyone know if this is the correct way to do this sort of thing, or how to
get it to work...?

Cheers,

--
Bob Arnott

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to