Calling a function on Button click in elementor - php

I am new to WordPress and elementor. I have created a form and I have to perform some functions on button click.
The functions are like redirecting to different or validating some information.
I inserted the HTML code element in the section and created the form. But I am not clear where to write the function and how to call it.
Below is the HTML code
<input type="text" id="IMEI" name="IMEI" placeholder="Enter your IMEI here" class="textbox">
<input type="button" class="buttonchk" value="Check Phone">
<br>
<br>
Can someone please help

Related

Two HTML Submit buttons for one FORM

I have the following form in my HTML. The form is used to submit the data to a PHP file, which would then send notifications to android Phones. Now I would need an addition. I need to submit the same data to another PHP file, which would submit the data to another PHP page, which would send the notifications to Apple devices. I prefer to use two different PHPs for andorid and iOS. How can I place two buttons for the same form? The below is my HTML form.
<form action="notifdatabaseonlyios.php" method="post">
<label class="lb">Title</label>
<input type="text" name="title" class="form-control" />
<label class="lb">Description</label>
<textarea class="msg" name="desc"></textarea>
<br>
<input type="hidden" name="type" value='notification'>
<button class="btn btn-info pull-right">Submit</button>
</div>
</form>
one method:
Give 2 buttons in the form with different button names, If user clicks the first button go to notifdatabaseonlyios.php
if ($_POST['button1'])
{ }
else if($_POST['button2'])
{ }
?>

2 form actions in interspire email marketer

My client is using interspire email marketer, which generate html form, and save all data into crm database.
In the form, there is a postcode area, my client wants to send email alert to different department based on this postcode.
I am thinking to create a seperate php file to match the postcode and send email alert.
But there is already a form.php in action. How can I add another action? Or is there any better way to achieve this?
Many Many thanks.
Below is the form code:
<form name="ppt_form" class="ppt-form" method="post" action="http://na03.mypinpointe.com/form.php?form=332" id="frmSS332">
<p><span class="required">*</span>Your Email Address:<br />
<input type="text" class="email" name="email" fid="e" fname="Email" ftype="Email" reqd="1"/></p>
<p>Phone:<br />
<input type="text" name="CustomFields[8]" id="CustomFields_8_332" value="" fid="8" fname="Phone" size='50'></p>
<p>Postal: <br />
<input type="text" name="CustomFields[20]" id="CustomFields_20_332" value="" fid="20" fname="Postal" size='50'></p>
<p><input type="button" class="update-button" value="Submit"/></p>
</form>
Eventually I leave the form with 1 action.
and add a ajax on button click.

How do I get the email value using the query string method?

I am using two plugins for Popup, window plugin and newsletter plugin. when popup shows, it displays the EMAIL field and Subscribe button
If customer enter the email and subscribe, the form action will redirect to Subscribe-page.php and the email value is returned from the poupup window
here is the code for popup window form
<form onsubmit="return newsletter_check(this)" action="http://www.example.com /subscription/" class="content-sxzw" method="post">
<input class="newsletter-email" type="email" placeholder="Your email here" name="ne" size="30" required>
<input type="submit" class="submit-sxzw" value="{{subscribe-button-text}}" />
</form>
Demo
How do I get the email to subscribe page using the query string method?
I think this is kind of basic jQuery stuff. You can get email by this code
var userEmail = $(".newsletter-email").val();

Wordpress Recaptcha use on form that created using page

I am trying to use a wordpress recaptcha plugin.
The plugin (like wp-recaptcah, better Wp recaptcha) that I am trying to use is only working for the comment form.
But in my case I have created a page and there I have inserted HTML that is managed from the admin panel.
I don't understand how I can use the plugin with my form.
I did not get any shortcode HTML tag to use it directly on the page.
Any suggestion how I can achieve this?
I have created a page in the admin panel and inserted this code. My form is submitted via AJAX:
<div class="First"> Here some static Html is used </div>
<form id="main-form">
<div>
<label>Name</label>
<input class="span6" type="text" maxlength="45" name="name" />
</div>
<div>
<label>Email</label>
<input class="span6" type="text" maxlength="45" name="email" />
</div>
<div>
<label>Phone Number</label>
<input class="span6" type="text" name="phone" placeholder="Enter Phone Number" />
</div>
<div>
<label>Message</label>
<textarea class="span12" name="message" rows="6" ></textarea>
</div>
<div><button class="btn >Send Enquiry</button></div>
</form>
<div class="second">Here some static Html is used </div>
Best suggestion: use Contact Form 7 and Contact Form 7 reCAPTCHA Extension or the Really Simple Captcha plugin, both work well with Contact Form 7.
You'll create the form on the CF7 admin page, then insert it into your WordPress page with a shortcode, which, for many reasons, is much better than writing the form itself in the WordPress text view.
You may use reCAPTCHA Form . It give u a form along with the recaptcha.
http://wordpress.org/plugins/recaptcha-form/
or else you may be wanting the following one instead,
http://wordpress.org/plugins/wp-recaptcha/

Trying to add a "check availability" option to my register form

I am trying to add a "check availability" option for the username in my register form.
I have tried using the button tag, but my HTML5 validation prevents the code from being run. Here's my form, oversimplified:
<input type='text' required>
<!-- The button !-->
<button onclick='isAvailable()'>Check Availability </button>
<input type='password' required>
<input type='email' required>
If the user does not enter a username, password, and (valid) email, then the browser returns an error when the button is clicked.
I have tried using a link instead, but I don't know how to run my PHP code through it. Can anybody help?
Add a return false; to the onclick event.
<button onclick='isAvailable(); return false;'>Check Availability</button>
And use an Ajax call for the isAvailable() function to check the availability.
Try to use jQuery library. You can use this: http://api.jquery.com/jQuery.get/ to get return from your url: http://example.com/checknick.php?&nick=...

Categories