Pulling data from interface
-
Is there a cleaner way to pull a lot of data from a form for calculations? I feel like I have a lotta ugly tryparse stuff going on. Do people just pull it in one go? I have like 40 controls a user can change (trust me, it can't be helped) and on recalc its a lot of pull, calculate, put back. Seems horribly messy.
-
Is there a cleaner way to pull a lot of data from a form for calculations? I feel like I have a lotta ugly tryparse stuff going on. Do people just pull it in one go? I have like 40 controls a user can change (trust me, it can't be helped) and on recalc its a lot of pull, calculate, put back. Seems horribly messy.
So I guess you don't want to put Javascript in your form to do the calculations ? I have a fairly complex form with the same problem. I have 2 routines, one to map the screen to internal values and another to map the internal values to the screen. Ugly. Yes; but it works and it is straight forward.
-
So I guess you don't want to put Javascript in your form to do the calculations ? I have a fairly complex form with the same problem. I have 2 routines, one to map the screen to internal values and another to map the internal values to the screen. Ugly. Yes; but it works and it is straight forward.
Not especially no... for one Javascript still isn't as 'native' to me as a language. I imagine I'd have to learn some jquery to handle any of the database pulled information? using javascript would at least get away from the parsing due to the weak typing though eh?
-
Is there a cleaner way to pull a lot of data from a form for calculations? I feel like I have a lotta ugly tryparse stuff going on. Do people just pull it in one go? I have like 40 controls a user can change (trust me, it can't be helped) and on recalc its a lot of pull, calculate, put back. Seems horribly messy.
I have a huge product editor, with over 80 fields. I'm on my 8th generation of it now. The last update I made was to create a huge Javascript object of the entire thing, and small saves just update the object in the DOM, Full saves use $ajax to update the database. Validation is on the fly using blur When clicking through the tabs, the data is loaded from the object. It took me a 2 week to write, over 10K lines of Javascript, but so far so good, no complaints after 3 months of running it. It's a combination of Javascript and JQuery, but mostly Javascript.