Bookmark Topic Watch Topic
  • New Topic

problem with submit and redirection {javascipt struts under google chrome}  RSS feed

Posts: 9
  • Mark post as helpful
  • send pies
  • Report post to moderator
i developed one application using struts , i have tested it with Firefox ad IE i works verry well but i have got problem with google chrome,
the problem is that : whene i click on one button i excpect that the rattched javascipt function submit first oen form then redirect me to another link, but under google chrome , the form isn't submitted (for Firefox and IE no problem)

the function
function cll()

var p=document.getElementById('myLink').href;
location.href =p;

the form :

<form id="myform" action="" method="post">
<html:hidden name="urlt0" property="url_page_t0" value=""/>

the button
<td class="divleft"><div align="center" ><a id="myLink" href="/projet_web/" >
<input type="hidden"/></a>
<input name="button" type="button" class="inputbutton" value="Recherche" onclick="cll()" />
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Report post to moderator
This problem seems to have nothing to do with Struts or JSP or even Java for that matter. It is about javascript and there is a a forum for javascript conversation on this ranch.

1.) is you button outside of any html form? Is that allowed in HTML?
2.) Your javascript function sends the form FIRST and THEN tries to change the address. Why?
Author and ninkuma
Posts: 66351
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please click this link ⇒ CarefullyChooseOneForum ⇐ for more information.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!