javascript - append function not working to textarea after text edited -



javascript - append function not working to textarea after text edited -

append function not appending when textarea text edit . tried pull in current value, append, , set back. not working .

function getserial() { var getvalue = $(serial).val() + ",\n"; var showvalue = "#showserial"; $(showvalue).append(getvalue); }

if utilize val() replace before submitted value . value of text-area added comma al-2, al-3 every single submit .

try using val() instead of append(): i've created test fiddle, work you?

function getserial (){ var showvalue = $("#showserial"); var getvalue = $(serial).val()+ ",\n"; if(showvalue.val()){ $(showvalue).val(showvalue.val() + getvalue); }else { $(showvalue).val(getvalue); } }

https://jsfiddle.net/mc5rrkmu/1/

javascript jquery

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -