creating button using <s:button> - similar to the CSS based button
Shashank Rudra
Ranch Hand
Joined: Mar 26, 2009
Posts: 131
posted
0
Hi Guys
I am having a JSP with simple form.Here these things are to noted
1. using <a..><span> to create a button using CSS with sliding-door approach. The image can be seen in the attachment.
2. submitting the form on press of Enter key in the form area - the code in the form tag
3. submitting the form after doing a client side check for valid inputs
I want to convert this form with struts tag based form i.e. <s:form..>. However I am facing some problems in
1. converting the button HTML with <s:submit...> tags to create button
2. apply the enter key event capture and submit for there after. (onKeyDown is not a valid attribute for <s:form -tag)
3. can we still do the JavaScript validation
I am not able to figure out, as how to achieve these results. Any help in this regard will be highly appreciated. Thanks in advance guys. >
This is a reasonably complex HTML layout--you're either going to want to create your own theme or just continue doing the form's internals by hand. You might need to tweak the form element names to conform to what S2 expects, but in general the form element names are just the names of the corresponding action properties.
Shashank Rudra
Ranch Hand
Joined: Mar 26, 2009
Posts: 131
posted
0
great, wat you said about the naming standards is correct (I cross checked with the view source). So following the same here is the new form tag. But still not able to get the desired result. Thanks pal for your efforts in helping me out.
Actually wat is happening here is (when I saw the view page source) The form tag is being rendered as As apparent the js code is being scrapped. How to retain that piece in the resulting form Tag.
Looking in the form-common template it does, indeed, appear to ignore the "onkeydown" attribute (don't know why).
Which version of S2 are you using? At some point the ability to use dynamic tag attributes was added, but I don't recall when that was (or if it's a taglib-wide setting).
Shashank Rudra
Ranch Hand
Joined: Mar 26, 2009
Posts: 131
posted
0
I am using Tomcat5.5 i.e. JSP2.0. Though I am not sure - if this is what you asked for.