I have view for entering new entity. On that view I have two buttons: one for saving new entity and another button should enter value into textbox on 开发者_StackOverflowthat form but I can't achieve this, the value in the textbox stays same as it was on page load. Does anyone know how to do this? Thx
There are two possibilities:
- Use javascript
- Reload the page with additional query string containing the new value
Example with jquery:
<input type="text" name="foo" id="foo" value="old value" />
<input type="button" id="update" value="Update value" />
and the script
$(function() {
$('#update').click(function() {
$('#foo').val('some new value');
});
});
精彩评论