Hi I have some code..
开发者_高级运维$(document).ready(function() {
$("#inputPageName").keyup(function () {
var value = $(this).val();
$("#inputPageHandle").val(value);
}).keyup();
});
Basically I need to create a page handle in a hidden field so when the user type in the PageName field it update the PageHandle field however I want to use jQuery.trim() to remove the spaces that the user my put in the PageName field
Any ideas?
You need this?
$(document).ready(function() {
$("#inputPageName").keyup(function () {
var value = $.trim($(this).val());
$(this).val(value);// <-------
$("#inputPageHandle").val(value);
}).keyup();
});
EDIT:
maybe you need:
$(document).ready(function() {
$("#inputPageName").keyup(function () {
var value = $.trim($(this).val());
$(this).val(value);// <-------
$("#inputPageHandle").val(value);
}).keyup();
$("#inputPageHandle").keyup(function () {
var value = $.trim($(this).val());
$(this).val(value);// <-------
$("#inputPageName").val(value);
}).keyup();
});
精彩评论