Please check this code again....

"Undefined" is coming instead of "name_txt" value, when in browser.