Reputation: 331
Is there is some way to clear fields after success submit in grails application?
<g:formRemote name="songList" url="[controller: 'SongList', action:'create']"
update="[success: 'updateSongList', failure: 'error']">
<div class="form-group">
<label for="songList">Enter name of song list:</label>
<g:textField name="title" class="form-control" id="songList"/>
</div>
<g:submitButton name="Create" />
</g:formRemote>
or I should write custom code for this? In grails tag g:formRemote there is method onSuccess, but how correct use it in this case don't imagine.
Thank you.
Upvotes: 0
Views: 526
Reputation: 10665
Just put this:
$('form[name="songList"]')[0].reset()
with in your success method: updateSongList()
Upvotes: 2