I use this code to load data into my textarea:
jQuery('.content_container').load('http://www.evedalsvardshus.se/plugins/calendar/edit_dates.php', {'value': datum} );
But when I try to load data into my input text form with this code:
jQuery('.header').load('http://www.evedalsvardshus.se/plugins/calendar/get_header.php');
Nothing happens. The get_header.php contains only “asdsd”.
Can anyone help me?
That’s because the
.load()function tries to set the inner HTML which doesn’t work for a text field. You need to set its value instead:The
.get()function sends an AJAX request and in the success callback set the value of the text field.