BluePhoenixNC Posted March 25, 2006 Share Posted March 25, 2006 First things first... english is not my native language, so I apologize if my explantaions are long winded or problematic to understand. Here is my problem: I have a form in which next to some simple data (Name address etc) some calculated values need to be produced and be able to be stored in a DB.I.E a mortgage Calculator comes to mind (same principle). Here is what I have so far:Form with input (name and address and some values to do calculations with. I was thinking about sessions by parsing the information to another form PLUS the calculated values, but there are more than one calculation to be performed and it should be "flexible" to allow several scenarios. So now I am stuck. take Excel for example I can put in field 1 and field 2 a value, have that calculate in field 3 but the header is untouched (Name address etc.) By searching the board I heard of AJAX, but I have no clue how to implement that. I was also thinking about IFRAMES but can I do calculations in there independently from the main form, so I can then pass ALL variables to another Form and then save to DB ?! I am stumped and don't really know how to proceed with this....Thanks for the help, in advance Quote Link to comment https://forums.phpfreaks.com/topic/5737-o-calculations-on-same-page-and-able-to-store-to-db/ Share on other sites More sharing options...
AV1611 Posted March 25, 2006 Share Posted March 25, 2006 I post multiple data queries to different iframes based on a single input form on a site... it works great for me. You should have no problem with what you are trying to do. You could perhaps take the form, then ask them from a listbox what to do with the data Quote Link to comment https://forums.phpfreaks.com/topic/5737-o-calculations-on-same-page-and-able-to-store-to-db/#findComment-20459 Share on other sites More sharing options...
BluePhoenixNC Posted March 25, 2006 Author Share Posted March 25, 2006 [!--quoteo(post=358127:date=Mar 24 2006, 10:31 PM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Mar 24 2006, 10:31 PM) [snapback]358127[/snapback][/div][div class=\'quotemain\'][!--quotec--]I post multiple data queries to different iframes based on a single input form on a site... it works great for me. You should have no problem with what you are trying to do. You could perhaps take the form, then ask them from a listbox what to do with the data[/quote]hmmm it's late and after almost a week of trial and error, I might be a bit slow in understanding. Say I have a form structred like that: [code]<form><table ..><tr><td><input class="frm" type="text" name="d_ccity" size="30" /></td></tr><tr><td><input class="frm" type="text" name="d_State" size="30" /></td>...<td><iframe> <form action="<?=$thisform;?>"><table><tr><td><input class="frm" type="text" name="x" size="30" /></td></tr><tr><td><input class="frm" type="text" name="y" size="30" /></td></tr><tr><td><input class="frm" type="text" readonly name="z" size="30" value="<?=echo phpfunction(x+y);?>" /></td></tr><tr><td>[calculate]</td></tr></table></form></iframe><tr><td>[Submit]</td></tr></table></form>[/code] <-- very simplified codeThat upon hitting the submit button, not only the city and state variables but also the x,y,z variables will be saved into a session ? and therefore usable for future procedures ? If that would be that easy, that would be awesome, but for some reason I am not sure that this works. I might have a logical Jetlag. Any guidance is greatly appreciated. Thanks for the quick response. Quote Link to comment https://forums.phpfreaks.com/topic/5737-o-calculations-on-same-page-and-able-to-store-to-db/#findComment-20467 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.