-
Jan 20th, 2012, 08:51 AM
#1
Thread Starter
Hyperactive Member
Create JSON to send to server
Hi,
I managed to create something where I have an set of hidden inputs (all share the same class name)
The "id" of each is the date in a format of "yyyy_mm_dd".
The value of each input is empty.
When the user check a checkbox next to each entry (date) I bring up a dialog (text area), allow the user to enter something and then insert that text to the value of the hidden input.
When one "submit" the form (I prevent it though), I want to build up some kind of "array" of dates (that silly format I use as Id is ok) and and the text (if any) the user entered for that day and post it as JSON to a server side controller action (I used Asp.Net MVC)
I can get all the values I require now in my JavaScript code, but not sure how to build up a JSON object and have my controller action be able to process it though.
Any online sample would do the trick, unless someone feel like explaining.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|