How to call a Plugin made by myself on submit of HTML?
-
I have created a custom plugin in php where I included my HTML page and I want to invoke a function in this page on submit of HTML form.
Note that I have included my server.php (custom plugin) in same folder of my html page.
invoke a function in this page on submit of formThis is my HTML form
#######################################################################################
<?php get_header(); ?> <div id="content"> <form method="post" action=""> <label for="firstName"> First Name </label> <input id="firstName" name="firstName" type="text" required/> <label for="lastName">Last Name </label> <input id="lastName" name="lastName" type="text" required/> <label for="birthDate">Birth Date </label> <input id="birthDate" max="2018-12-31" min="1900-01-01" name="birthDate" type="date" value="2018-01-01" /> <label for="employeeID"> Employee ID </label> <input id="employeeID" name="employeeID" type="number" required/> <label for="companyEIN"> Company EIN </label> <input id="companyEIN" name="companyEIN" type="number" /> <label for="fileToUpload"> Upload supporting documents </label> <input id="fileToUpload" name="fileToUpload" type="file" multiple> <input id="submit" type="submit"> </form> </div><!-- /#content --> <?php get_footer(); ?>
#######################################################################################
This is my PHP plugin in same folder<?php /*Plugin Name:Sample server Description:Trying Sample server.php version: 1.0 Author :Jegan */ function html_form_code() { include('serverform.html'); } function form_print() { echo "Invoked"; } add_action( 'init', 'form_print' ); add_shortcode('sampleServer','custom_form_shortcode');
I need to invoke this form_print only onsubmit of HTML page and I need to send some message to HTML form. what should be my add_action in this case.
Looking forward for your reply.
- The topic ‘How to call a Plugin made by myself on submit of HTML?’ is closed to new replies.