Posts

Showing posts with the label form-submit

Retain dynamically submitted select options on form submit

Image
Clash Royale CLAN TAG #URR8PPP Retain dynamically submitted select options on form submit I have an html form with a dynamically populated select: <form action="/" method="post" onsubmit="beforeSubmit()" id="crypto_form"> <textarea name="message" id="textarea_message" oninput="this.value.toUpperCase()" cols="60" rows="5" placeholder="Enter Message"></textarea> <select form="crypto_form" name="keydata" id="select_keydata"></select> <button type="submit" name="type" id="btn_encrypt" value="encrypt">Encrypt</button> <button type="submit" name="type" id="btn_decrypt" value="decrypt">Decrypt</button> </form> The problem is that when I submit the form, all select values disappear. How do...

differentiating multiple submit button using PropertiesMethodNameResolver

Image
Clash Royale CLAN TAG #URR8PPP differentiating multiple submit button using PropertiesMethodNameResolver I have a form with different submit buttons in Spring MVC application which is in xml . I differentiated using ParameterMethodNameResolver like <bean id="mnr" class="pkg.ParameterMethodNameResolver"> <property name="paramName" value="opt"/> </bean> But the problem here is, Method names are tightly bounded to button captions. So any modification in UI will affect java application. So I just want to use PropertiesMethodNameResolver .I used like <bean id="mnr" class="pkg.PropertiesMethodNameResolver"> <property name="mappings"> <props> <prop key="user.htm?opt=save">register</prop> <prop key="user.htm?opt=delete">remove</prop> </props> </property> </bean> But it ...