For those of you familiar with using xml --
I want to be able to code an xml form which will do basic mathmatical operations and store data. For exmple, my end user would see a form that said "Enter X" and "Enter Y", and after the user entered X & Y, the page would calculate X/Y, display the result, and then store everything.
Now, my actual question is not "how do I do this?" but "how annoying is it to learn enough xml to know how to do this sort of thing?" It seems like a simple enough kind of thing, but I've not actually coded in xml before. I will have access to an exceedingly simple xml form designer which will do the "enter and store X&Y" part, but not do operations based on the data entered. I kinda want to just manually edit the designer's code and add the other stuff, but I'm not sure if this falls in the category of "browse webpages on xml coding and figure it out" or "get an xml book and figure it out" or "1-day training course" or "college class". Suggestions?
I want to be able to code an xml form which will do basic mathmatical operations and store data. For exmple, my end user would see a form that said "Enter X" and "Enter Y", and after the user entered X & Y, the page would calculate X/Y, display the result, and then store everything.
Now, my actual question is not "how do I do this?" but "how annoying is it to learn enough xml to know how to do this sort of thing?" It seems like a simple enough kind of thing, but I've not actually coded in xml before. I will have access to an exceedingly simple xml form designer which will do the "enter and store X&Y" part, but not do operations based on the data entered. I kinda want to just manually edit the designer's code and add the other stuff, but I'm not sure if this falls in the category of "browse webpages on xml coding and figure it out" or "get an xml book and figure it out" or "1-day training course" or "college class". Suggestions?
no subject
Date: 2010-04-28 06:38 pm (UTC)A piece of information in a field in the document can be represented as an XPath selector like: //form/field[@name='X'].
That of course presumes that the document represents user input fields as tags like <field name='X' controlType='text' /> in the final XML.
From your description, they have an event handling model wherein you can attach javascript methods or blocks to specific triggers (like the value in a field changing). The javascript would then involve using their documentation of how to select a field from the form and extract its value.)
Equivalent in html:
function addTwoFields(){ // this doesn't do error checking or any other sensible thing var x = new Number(document.getElementById('fieldOneId').value); var y = new Number(document.getElementById('fieldTwoId').value); document.getElementById('fieldThreeId').value = (x+y); }This is NOT what I'd call production grade javascript, but illustrates using number to get relatively validated values rather than concatenating strings in the users-can't-type case...
no subject
Date: 2010-04-28 06:47 pm (UTC)no subject
Date: 2010-04-29 02:21 pm (UTC)