tags:

views:

19

answers:

1

I want to open up browser dialog box when user click a button, and afaik this can be done by using a FORM tag.

The problem is the server only accepts json data (and using the form tag it has to have a name i.e.

formdata={"key":"value"}   


The server does not like this format as it expects pure JSON

{"key":"value"}


Is there a way to send JSON data using FORM tag ?

A: 

Looks like you will have to build your json object by hand onClick (read out your forms input fields and place them in an object according to the json specification).

Thariama
@Thariama what I ended up doing is to post the xml data (retrieved asynchronously before) to a jsp which will parse the request and write the xml data into outputWriter which then prompts the DownloadDialog box. Not pretty as it is not fully javascript.
portoalet
well, if it works reliable ...
Thariama