Table inside form

asterios2000 13 Dec, 2012
Hello everybody after a lot of search i've tried to use a table inside a form in order to do a warehouse order, in sort when a user logs on to my site he can order to a warehouse but not only one element but multi so the form should look something like this (without the price)

[attachment=0]Order-Form[1].gif[/attachment]

Is it possible to do that on chrono forms?

Thanks in advance
GreyHead 13 Dec, 2012
Hi asterios2000 ,

Sure, I'd use a series of Custom Element elements to build the table and the custom parts of the layout.

Bob
asterios2000 13 Dec, 2012
So i would use inside just html or i can use again php because the records are going to be imported in a db table!???

Thanks for your answer
GreyHead 14 Dec, 2012
Hi asterios2000,

You can use PHP in a Custom Code action or a Custom Element element. I prefer to put the main code to get and process the data I need in a Custom Code action and then just that needed to create the HTML in a Custom Element element . . . but that is just my preference.

Bob
asterios2000 17 Dec, 2012
ok i finally manage to do that the final view is like the attachment.



As you can see there's an HTML table with 3 rows. In this table the user can add or remove rows dynamically.

So, i know that in order to save table's data to my DB table i have to know how many rows exist there. (I managed to do that) But how i send my data in my DB table when i press the submit button.

The DB save component is great but it is for static fields only!🙂

Thanks in advance!
GreyHead 17 Dec, 2012
Hi asterios2000,

I'm afraid that you have to hand-code the MySQL query to save the multiple records; I assume that you are saving them in a separate table?

Bob
asterios2000 17 Dec, 2012
Yes they are in a saparate table both in my front end and in my DB, the problem i face here is how to pass the table's row data inside my DB table on submit.

I know how to execute the querry with multiple values, i also know how to count data while i'm in the form using JS. The thing i don't know is how to pass these values with php and sql commands using chrono forms. If a used pure php there are a lot of examples that chronoforms do not accept (like the tag <form>)

Can you please direct me to a proper link or solution, thanks!
asterios2000 18 Dec, 2012
Please any help would be considerable!
GreyHead 26 Dec, 2012
Hi asterios2000,

I've read this a few times but I'm afraid that the English doesn't make any sense to me so I'm still not clear what you are asking :-(

You can use any valid PHP (or MySQL) in a ChronoForms Custom code action . . . but '<form>' is HTML not PHP and you wouldn't need it anyhow.

Bob
asterios2000 18 Jan, 2013
It's ok i figured that out! Thank you very much!
This topic is locked and no more replies can be posted.