php - Dynamic Form Action - Determine Action With Variables -
I have a form in the codeigner, and I need to change the verb of the form that is in real form.
Meaning: If & lt; Select name = "type" & gt; <=> Business
then I need action = "business / submit"
Is that an easy way to do this?
Try now Try Javascript to get data from input, and then send it to a dynamically generated link - though this is not ideal for my situation.
Thoughts?
> I have never worked on CodeIgniter but I can tell you how to do it in PHP can do. You have to understand that you can not "dynamically" this without javascript as you suggested that you do not want to use javascript, I have a dirty way to handle this situation. I am suggesting. You can not modify the action attribute with PHP alone, so we can include that file on a PHP file and then select (from your selection box) that you have the wanted. You can use switch case or on the basis of your choice. This is just an indication. Please do not follow me for not following any standard measures or believe me!
& lt ;? Php // sample code snippet ($ _ POST ['type'] === 'some') {Include 'some .php'; } And if ($ _ POST ['type'] === 'some ELSE') {include 'some ELS.fp'; } Other (Includes 'completely different.en.php';} // continue your code? & Gt;
Comments
Post a Comment