CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Use a Button for two forms.

Print topic Send  topic

Author Message
popularanky

Posts: 53
Posted: 05/27/2011, 4:39 AM

I have two forms (Form1, Form2). Using Php, I want to use one button (Button_insert) to control the two forms. That when the button is click, it insert the values in the forms into it's respective tables in the database.
_________________
EKERE UBONG UBONG
IT Officer
CognitiveDrive
View profile  Send private message
andy


Posts: 183
Posted: 05/27/2011, 6:18 AM

You won't be able to do that easily.
Form submissions only allow you to submit a single form. You won't be able to submit forms in series either, at least not out of the box.

You might like to think about either using AJAX (update db) which, for example, updates form 2 when you hover your mouse over or click the submit button for form 1.... ??

You can also do it programmatically by getting the values in form 2 and updating the related table in form 1's Before Update event... ??

There are related posts in the forums. Search around a little.
Good luck.
_________________
Andy

RAD tools for rich UI controls:
http://www.koolphptools.com
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 05/27/2011, 9:15 AM

Hi,

I were working on this issue some days ago,

What I did was work over the html view getting one form

and splitting it up on two tables with two <br> within the tables,

then seems like there´s two forms and just one button to save.

Maybe could be a possible solution.



Quote popularanky:
I have two forms (Form1, Form2). Using Php, I want to use one button (Button_insert) to control the two forms. That when the button is click, it insert the values in the forms into it's respective tables in the database.

_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 05/27/2011, 9:19 AM

yes, that´s, php has to evolution and allow sending two or three forms at time on just one
click button.

Quote andy:
You won't be able to do that easily.
Form submissions only allow you to submit a single form. You won't be able to submit forms in series either, at least not out of the box.

You might like to think about either using AJAX (update db) which, for example, updates form 2 when you hover your mouse over or click the submit button for form 1.... ??

You can also do it programmatically by getting the values in form 2 and updating the related table in form 1's Before Update event... ??

There are related posts in the forums. Search around a little.
Good luck.

_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
cvboucher

Posts: 191
Posted: 05/27/2011, 10:13 AM

Depending on what database you are using you could create a stored procedure with the fields from both tables as parameters and then insert into both tables. You could have the added benefit (if needed) of putting it in a transaction so if one of the inserts fail then the transaction is rolled back and neither of the inserts are saved.

Craig
View profile  Send private message
scarvello

Posts: 64
Posted: 06/01/2011, 4:09 PM

Try this:
http://stackoverflow.com/questions/1927618/is-to-possib...-simultaneously
View profile  Send private message
cleyan


Posts: 136
Posted: 06/07/2011, 3:59 PM

Hi,
I use jquery to do that, I use on the on click of the button or imagelink

$("#formid1").submit();
$("#formid2").submit();

or
$(".formclass").submit(); //to send all forms with class="formclass"

The forms have target="iframeid" where iframeid is one hidden iframe for each form

Regards


Carlos

PD: thid is my solution, maybe not the best but work for me ;-)
_________________
**************************************************
Carlos Leyan B.
Temuco, Chile
www.leytec.net
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.