Announcement Announcement Module
Collapse
No announcement yet.
Using spring form:input tag Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using spring form:input tag

    Hi,

    I'm working on a JSP that will display an old and new address value on a page.

    So for a street address. When I display the initial value I have <form:label path="command.street"/> and I also want a input form that binds to this same command attribute for user input <form:input path="command.street"/>

    Is there a way to get the form:input to show an empty field, and still bind? I was hoping to have a value attribute that I could set to empty string, but no luck.

    Thanks in advance.

  • #2
    you can do it by javascript

    Code:
    <script type="text/javascript">
            function clearInput(id){
    	     document.getElementById(id).value = "";
    	}	
    </script>
    
    <form:input id="street" path="command.street"/>
    
    <script>clearInput('street');</script>
    input field will be cleared and your binding will work without a problem

    Comment

    Working...
    X