Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. $("#name_field_id").focusout(function(){
  2. str = $(this).val();
  3. if(str){
  4. s = str.split(/(?<=^S+)s/); //split string in name field after first space found.
  5. $("#hidden_field_id").val(s[1]); //s[1] value after the first space set to hidden field.
  6. }
  7. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement