Jump to content


Photo

:o calculations on same page and able to store to DB


  • Please log in to reply
2 replies to this topic

#1 BluePhoenixNC

BluePhoenixNC
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 25 March 2006 - 01:58 AM

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

#2 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 25 March 2006 - 03:31 AM

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

#3 BluePhoenixNC

BluePhoenixNC
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 25 March 2006 - 04:25 AM

[!--quoteo(post=358127:date=Mar 24 2006, 10:31 PM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Mar 24 2006, 10:31 PM) View Post[/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:
<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>
<-- very simplified code
That 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.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users