Re: [Xsltforms-support] form submission via JavaScript, co-existence w/ jQuery
Brought to you by:
alain-couthures
From: Alain C. <ala...@ag...> - 2013-03-25 21:15:45
|
Hi Adam, > Looking at xsltforms.js, the line in > XsltForms_submission.prototype.submit that invokes JS is this one: > > eval("ser = (" + action.substr(11) + ");"); > > So my work-around is to make the garbage appended to the action > harmless by making it a comment: > > <xf:submission > id='submit' > method='get' > relevant='true' > replace='instance' > serialization='application/xml' > action='javascript:submit(ser));//' > /> > > The line of JS eval'd might be something like: > > ser = (submit(ser));//?var1=val1&var2=val2... By default, XSLTForms is serializing the current instance with a get method in the query string: if ((method === "get" || method === "delete") && this.serialization !== "none" && action.substr(0, 9) !== "opener://" && action.substr(0, 8) !== "local://") { var tourl = XsltForms_submission.toUrl_(node, this.separator); action += (action.indexOf('?') === -1? '?' : this.separator) + tourl.substr(0, tourl.length - this.separator.length); } The test condition could be extended for Javascript: && action.substr(0,11) !== "javascript:" Could you please test with this? > Also, can XSLTForms co-exist with jQuery now? Currently I put my > forms into iframes, which is mostly OK, but it would be nice in future > to have everything in one integrated page. > I think that some XSLTForms users have already mixed it with jQuery. Do you have a test case which doesn't work? Thanks! -Alain |