Transfer Data From Javascript Popup Multiline Textbox To A Select Control
I am trying to transfer data from a multiline textbox to a select control. The multiline textbox appears as a popup and I want all the records pasted in the textbox to be transfer
Solution 1:
You could serialize the contents of the textarea and then do what you need to do with it (Post it to a controller or perhaps hand it off to the underlying page somewhere)
$('form').submit(function(e){
e.preventDefault();
e.stopPropagation();
var o = {};
$( $('textarea').val().split(/\n|\r/) ).each(function(i){
o[i] = this;
});
var jsonString = JSON.stringify(o);
// DO SOMETHING WITH JSON OBJECT HERE
});
Post a Comment for "Transfer Data From Javascript Popup Multiline Textbox To A Select Control"