HTMLFormElement.prototype.toJSONString

D

dhtmlkitchen

Does this sound useful?

HTMLFormElement.prototype.toJSONString

Grab the state of the form, as if it were going to be submitted and
return the value as a JSON string where keys are form element names.

(checkbox (groups) and select-multiple would map to an array).
 
T

Thomas 'PointedEars' Lahn

Does this sound useful?

HTMLFormElement.prototype.toJSONString

Grab the state of the form, as if it were going to be submitted and
return the value as a JSON string where keys are form element names.

(checkbox (groups) and select-multiple would map to an array).

HTML element objects are host-defined objects that do not have a public
constructor except in the Gecko DOM.


PointedEars
 
M

Martin Honnen

Thomas said:
HTML element objects are host-defined objects that do not have a public
constructor except in the Gecko DOM.

The following works fine with me with Opera 9:

HTMLFormElement.prototype.aMethod = function () { alert(this); };
var form = document.createElement('form');
form.aMethod();

Safari 3 beta also has no problems with that.

Can you test with the latest Konqueror release?
 
D

dhtmlkitchen

My idea is to propose it to Mozilla on the toJSONString bugzilla bug
(mozilla) to see if they accept the idea.

I also think that something like aForm.getData() might be useful to
get the serialized representation of the form. (It would look just
like what you see in a GET query string or a POST body.)

I thought I'd run it by here first before filing a bug for Mozilla
(and WebKit).

Garrett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,414
Latest member
GayleWedel

Latest Threads

Top