I am working on a project where a user is going to select a document and it will be placed into a dynamic and sortable list. The list items will have a value of the specific document’s id. Once the lists are arranged the user is to click Create List and I would like to use Ajax and classic ASP (required for a couple queires that need to occur during this process to grab the new string format) to grab the just the values of the list items and put them into an array.
Here is my list currently:
<ul class="main_doc_list">
<li><b>Editor's Blog</b>
<ul class="doc_list">
<li value="111111">Doc Title</li>
</ul>
</li>
<li><b>Blog Roll</b>
<ul class="doc_list">
<li value="222222">Doc Title</li>
<li value="333333">Doc Title 2</li>
<li value="444444">Doc Title 2</li>
</ul>
</li>
</ul>
And I currently have this in JQuery to trigger the Ajax event.
$("#create").click(function() {
$.ajax(
{
type: "GET",
url: "newslettercreate_action.asp",
success: function(result) {
var newsletter_string = $(result);
$("#scratch").val(newsletter_string);
}
});
})
Just not sure that once in my ASP action file how to obtain the values I need to begin the function of building the newsleter_string. Any help would be greatly appreciated.
As Porco have pointed, you can grab this with jQuery itself before posting, you just have to loop trough each element and concatenate the values to post it like Porco said:
To post the data, do what Porco have showed you and you can grab the results on ASP as a Request variable: