Skip to main content

developerWorks >  Web architecture  >  Forums  >  Web 2.0 Apps  >  developerWorks

json - hidden field    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is not answered.

Permlink Replies: 1 - Pages: 1 - Last Post: Sep 25, 2009 11:16 AM Last Post By: DanRumney
RADster

Posts: 2
Registered: May 26, 2006 09:07:54 AM
json - hidden field
Posted: Sep 24, 2009 10:50:35 PM
 
Click to report abuse...   Click to reply to this thread Reply
Hi everyone. I have a json object on a page which needs to be send to the server when the entire form is processed. Would it be possible to put the json object in a hidden field to be send to the server? if so, how would parser work in the server? and how would it work when sending the json back to the client. Unfortunately, we can't use any dojo for this.
Thanks in advance!
TJ
DanRumney

Posts: 210
Registered: Jul 20, 2007 01:32:39 PM
Re: json - hidden field
Posted: Sep 25, 2009 11:16:04 AM   in response to: RADster in response to: RADster's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi,

I don't normally like to second guess posters' designs, but I do wonder why you need to send a JSON object to a server.

Anyway, I'll assume that there's a good reason. You can find a JSON stringifier here to convert a JSON object into a string, that you can then put into a hidden field for sending to a server.
Alternatively, you could parse the JSON object and turn it into a GET (or POST) query, rather then sending it as text.

Most server side scripting languages have JSON parsers available; just google "JSON Parser {language name here}". The same libraries usually provide JSON creation code.

Can I ask why you're sending JSON to the server?
 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums