- 0
Transmit an array of strings in a POST operation using Jquery/AJAX
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Download HTML, CSS, & JavaScript All-in-One For Dummies ($39.99 Value, now FREE)
By News Staff,
- ebook offer
- sponsored
- (and 5 more)
- 0 replies
- 0 views
-
Microsoft is making TypeScript 10x faster for developers
By pradeepviswav,
- microsoft
- typescript
- (and 3 more)
- 4 replies
- 0 views
-
Microsoft introduces TypeScript 5.8: Explore the latest features and enhancements
By zikalify,
- microsoft
- typescript
- (and 4 more)
- 4 replies
- 0 views
-
- 8 replies
- 2 views
-
Microsoft launches TypeScript 5.6 with a number of new improvements
By John Callaham,
- microsoft
- javascript
- (and 2 more)
- 1 reply
- 2 views
-
Question
Shadrack
Hello! I would like to submit an array of strings from a web form to my web service and need a little bit of hand holding. My web service I've written seems fine with having an array of strings as input but I'm not exactly sure how to encode this in javascript from my html form elements before I ship the data to my web service to be processed. The array of strings will be pretty small (on the order of 20x3 strings).
I suspect that there is a clever way to do this by coding the form correctly and just running a jquery .serialize() operation on the form and submitting it.
My first thought was to define a number of textbox inputs and give them incremental ID#'s such as "array0_0", "array0_1", "array0_2", "array1_0", "array1_1", "array_1_2", "array_2_1" etc.
Then as a first step before submitting the post, collect all the values in the textboxs and compile an array using 2 nested for loops. Something like that would probably work, but I was wondering if there was some magic that I could do in my form so that jquery recognizes an array of strings in my form so that the .serialize() function just does its magic.
Thanks!
-Shad
Link to comment
https://www.neowin.net/forum/topic/1137754-transmit-an-array-of-strings-in-a-post-operation-using-jqueryajax/Share on other sites
21 answers to this question
Recommended Posts