Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#name_field_id").focusout(function(){
- str = $(this).val();
- if(str){
- s = str.split(/(?<=^S+)s/); //split string in name field after first space found.
- $("#hidden_field_id").val(s[1]); //s[1] value after the first space set to hidden field.
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement