sorinbuda
Posts: 27
|
Posted: 05/07/2016, 11:17 AM |
|
Hi,
I need to add an extra task to the standard form action.
currently the standard form action is defined as {Action}
<form id="formID" method="post" action="{Action}" name="{HTMLFormName}">
I need to add to the set of tasks in {Action} someting like "/actionpage.php"
Any hints?
Kind regards,
Sorin
|
|
|
PCHome
Posts: 57
|
Posted: 05/07/2016, 11:58 AM |
|
If you generate the page, open it in the browser, then view the source code, you'll see that it has a value, which is to itself. CCS forms always submit to themselves where the actual work is done, then redirect to the page set in the properties. You can manually type in what you want but you would be bypassing the functionality although there are times when that's desirable. For example, if you created a Record it would need to submit to itself but if you simply created a form manually, then you could do the processing in another script and submit to it.
|
|
|
sorinbuda
Posts: 27
|
Posted: 05/07/2016, 2:39 PM |
|
I can change
define("FileName", "index.php");
with
define("FileName", "/actionpage.php");
or just change "{Action}" with "/actionpage.php"
but in this way, as you observed, it will bypass the other current form tasks and I do not want that because I need to validate some of the fields and to insert some values in a database
Kind regards,
Sorin
|
|
|
eratech
Posts: 513
|
Posted: 05/09/2016, 1:10 AM |
|
sorinbuda,
I strongly suggest you leave the {Action} in the template as it is, and use the Record Events to program any other functions. Making changes through the code will cause the Codecharge page to get confused and not accept your changes later on.
By default the Record forms will submit to themselves and do the usual validation, database Insert/updates and redirect to another page (or same page)
You would add code to the 'After Insert' event to do the other updates you want to do (such as inserting a record to another table based on the form field, or changing some other parameters and rediecting to another page)
Look in the online help for 'Execute Custom SQL' and the "After Insert" events, and when you want to do something, look in the Sample Applications provided with CCS and are outlined in the Online Help as well.
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
|