This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
How or where do I change form method and form action?
Started 16 years ago by waitz | 13 posts |
-
I am placing machform on a secure server, and for encryption I have to change the form method to "post" (if it is not already) and change the form action to "https://www.site/smime_email.pl"
I have searched the code for post actions, but it is not clear what to change. Where and how do I do this..?
Grateful for answers
Posted 16 years ago # -
If you are changing the form action to that perl script, then MachForm won't handle your form submission again.
It won't be saved into database and won't be sent to email.
Are you sure you want to do this?MachForm Founder
Posted 16 years ago # -
Hmmm... I'm checking out with the secure host if there is another way to encrypt it.
Posted 16 years ago # -
If you plan to use SSL to secure your forms, simply use "https://" to access your form.
This way, all your form submission are being transmitted securely using SSL.MachForm Founder
Posted 16 years ago # -
SSL makes it secured, but not encrypted, no? My host say:
"The purpose is to send the form data as an encrypted email message. It would not be compatible with any other data capturing method that you have in place. So, yes, you need to change it so Machform does not handle the submissions anymore. These two forms or data management are incompatible."
I guess I have to change the form action. And then it comes down to: Where do I do it?
Thanks,
RajanPosted 16 years ago # -
If you want to use a script with your forms; you do indeed need to seperate them from MachForm. You can create the form with MachForm or use the free service at http://www.phpform.org/ and then use the forms action="" field to enter your script that you are going to use for it.
You have to of course copy the source from MachForm in to a new file.
Hope this helps!
Posted 16 years ago # -
If you still prefer to use MachForm instead of phpform.org, then simply modify "includes/view-functions.php", search around line 1840 and you'll find this line:
<form id="form_{$form->id}" class="appnitro" {$form_enc_type} method="post" action="#main_body">
simply change the action there.
MachForm Founder
Posted 16 years ago # -
Thanks for input. I will still use MachForm, and then just change the line in view-functions.php
But for all other use of MachForm besides this encrypted variant, I will not change the form action, but keep the functionality of MachForm.
Posted 16 years ago # -
Oh, no... I hear from my secure host that I have to change the name of one of the fields from "element_61" to "thankyou"
Is this possible..?
Posted 16 years ago # -
Can you paste me the URL to your form?
Or send via mail to: customer.service [at] appnitro.comMachForm Founder
Posted 16 years ago # -
Of course, the forms are here: https://www.tan-ju.org/registration/view.php?id=3 and https://www.tan-ju.org/registration/view.php?id=5
Thanks
RajanPosted 16 years ago # -
Hi Rajan,
It's Look likes there are 2 different element id that you want to change.
1. Form 3 --> element_61
2. Form 5 --> element_23To do this, you need edit "includes/view-functions.php". Try to go around line 40 ~ 45, you'll see these code :
$element_markup = <<<EOT <li id="li_{$element->id}" {$error_class}> <label class="description" for="element_{$element->id}">{$element->title} {$span_required}</label> <div> <input id="element_{$element->id}" name="element_{$element->id}" class="element text {$element->size}" type="text" value="{$element->default_value}" /> </div>{$guidelines} {$error_message} </li> EOT;
try to replace with this one
if (($_GET['id'] == 3 && $element->id == 61 ) || ($_GET['id'] == 5 || $element->id == 23)) { $element_input = '<input id="thankyou" name="thankyou" class="element text '.$element->size.'" type="text" value="'.$element->default_value.'" />'; } else { $element_input = '<input id="element_'.$element->id.'" name="element_'.$element->id.'" class="element text '.$element->size.'" type="text" value="'.$element->default_value.'" />'; } $element_markup = <<<EOT <li id="li_{$element->id}" {$error_class}> <label class="description" for="element_{$element->id}">{$element->title} {$span_required}</label> <div> {$element_input} </div>{$guidelines} {$error_message} </li> EOT;
that code will change element name properties to "thank you".
MachForm Support
Posted 16 years ago # -
Thanks a lot. I had to change another text field into a paragraph field, because it changed the id to thankyou for that one also. But that is ok.
Posted 16 years ago #
Reply
You must log in to post.