开发者

PHP 200+ Form Fields

Just to give you a bit of background i have a system where there's certain calculations that need to be calculated in the main section, there'll be various form fields under different tabs, for simplicity sake i have 10 sections, all with 20 drop down boxes and when you change the value of one of the drop downs it's recalculated in the main area (various calculations etc.) now these form values need to be persisted and stored in a database and then saved and reloaded whe开发者_如何学Gon ever needed.

Logically i don't want the database to return 200records and then set the drop down boxes for them all manually (using maybe a switch statement) as that'll no doubt be a ball-ache.

Any suggestions?


Could you pull the records one or two select boxes ahead via ajax? Ie.

select1 <-- filled select2 <-- filled select3 <-- unfilled select4 <-- unfilled

Once select1 is selected, make an ajax call that fills select 3.


If they are all in 10 sections, you could write queries that only return the 20 values or so you need. Or you could possibly break them into multiple tables, and use a couple relational tables to keep them straight. As far as the calculations, just store those in the database as well, and use ajax or the post submits to recalculate and update them when necessary.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜