|
Hello.
I have a problem with <html:form> tag that is inside <logic:iterate> tag.
Here is code sinppet:
<table>
<logic:iterate id="searchElement" name="SviArt" property="listaArtikala"
scope="session">
<tr>
<html:form action="/dodajBasket" method="POST">
<td width=10%>
<html:text property="narucenaKol"/>
</td>
<td width=5%>
<html:image src="/skladiste/images/basket.gif" onclick="submit();" />
</td>
<input type="hidden" name="idArt" value="<bean:write name="searchElement"
property="idArt"/>">
</html:form>
</tr>
</logic:iterate>
</table>
I have some ordering system and I get informations about products from database.
Then I put those values in the session and I show them in table. In that thable
I have input field where user can write amonut of product he wants to order.
In the next action I get idArt (in hidden value) and I add amount of that
particular
product in some sum of amounts.
I have image to submite this form (insted of button).
My problem is that sometimes when I click the submit image (for one product)
form submits twice, so I got wrong sum of amount (like I order twice as much
of the same product). Real ugly part of that problem is that it appears random.
Sometimes form submits once (as it should be - about 65% cases), but sometimes
(35% cases) it works wrong. In debbug mode I saw that two same threads are
generated
(I said, in some cases).
What could be the problem?
Please, help.
Sasa
This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.