Recreating Facebook Comment Button. Submiting an ajax form - javascript

I'm trying to recreate the Facebook comment button. Right now, Facebook comments can only be submitted by pressing enter. I've successfully added a comment button to every textarea, but now I'm having trouble submitting the form. This is my code:
$('.UFILikeLink').after(' · <span><a class="submitbtn">Submit</a></span>');
$('.submitbtn').live('click', function(){
$(this).parents('form:first').submit();
});
The form submits to a page which is meant to be called with AJAX, giving me an error.

Related

Modal Pop up on Form

I have made a modal pop up which is working great when a button is clicked, but what I really want is for the modal to pop up when the form button is submitted and all my validation checks are passed using PHPMailer.
The modal on the page looks like this:
<button onclick="document.getElementById('modalPopUp').style.display='block'" title="Test Modal">Modal test button …</button>
<?php require $_SERVER['DOCUMENT_ROOT'].'/Library/Includes/modalWebFormThanks.php';?>
I realise that this is a button onclick event as it is published here, but I have been unable to get my PHP form submission to just load this modal when the form passes all validation in the PHP validation code and gives the 'thank you' message. This part works great except from this segment.
I have tried moving the code out of button, into div and changing the onclick to onload, but none of this works. The modal just doesn't appear.
How do I make this same modal just appear from the PHP 'thank you' message?

Ninja Forms - regenerate the form after submission or by a button click event

does anyone have any advice on how I may go about regenerating a Ninja form after successful submission or by a button click event?
To explain, I am using a ninja form in a popup/modal. The modal is displayed and form appears when a user clicks on 'enquiry' button.
Each time a user clicks to open the modal popup containing the form I would like the form to be reset/regenerated instead of showing the success message from a previous submission.
I have tried using CSS to hide the success message and show the form whenever someone clicks the enquiry button. Whilst this displays the form fine, the submit button doesn't seem to work in the same fashion - it still sends mail but it doesn't show the 'processing' message.
Anyone got any advice on a solution I could use?
Thanks in advance!
You should be able to edit a setting in the form editor that handles that:
Advanced > Display Settings > Clear successfully completed form

Drupal contact form validation and alert not working

I am trying to make a Drupal website. My issue is that - I am not getting any alert/notification after contact form submission.
The page redirects to the Home page. The Form is working fine as I can receive the mail for the contact form but It never shows any success/fail alert.
Moreover, If the required fields are left empty and the form is submitted, then the contact page only reload.
This happens only when I am using Venture theme.
I want alerts for required fields, success and fail notifications.
I am using Drupal 7.40.
Any help/suggestion is appreciated. Thank you

costum redirect after submit

I have this form: http://lawb.co.il/HTMLPage.html
When someone click on the submit button ("שלח טופס" ) they are automaticaly redirected.
How can I prevent this action after clicking on the "שלח טופס" button, or that the page will redirect to a page that I choose and still I will get the information that people fill in the form?
The code is here http://jsfiddle.net/TCpkb/4/
Can you help me with it pleas?
You need to submit using AJAX and then redirect manually to your custom page. If you cannot use JavaScript, there is unfortunately no way to control the redirection if you let the user directly submit the HTML form.

How do I fill and submit a form remotely?

How can I fill out and submit this form remotely: http://mta-nyc.custhelp.com/cgi-bin/mta_nyc.cfg/php/enduser/ask.php
The form asks for email and then it has a pull down menu and fields for Subject and Question.
Clicking the Next button takes you to a new page and in that page you click submit.
Can I fill this form and submit with one click from my site?
I will have a form in my site where the user will fill out his email and I will have pre-populated fields for Subject and Question and when the user will click the submit button the remote form will be filled and submitted.
How can I do this (with python and javascript)?
If you are submitting the page to your python backend, check out Mechanize.
Try twill - http://twill.idyll.org/python-api.html. I't some wrapper of Mechanize.
Issue a post to ~/api/feedback with the same headers and form data that their form produces?
Open up Chrome dev tools or whatever, go to the network tab, fill out the form manually once and copy the last HTTP POST?
Depending on the type of feedback on that form, the data will change. The data I posted looks like:
feedback: {"name":{"first":"Test","last":"Test"},"email":"test#test.co","feedbackType":{"service":{"sid1":10000,"sid2":14000},"categories":{"cid1":14308}},"attributes":[{"id":"branch_line_route","value":"F"},{"id":"traincarnumber","value":"1"},{"id":"date_of_event","value":"2020-09-10T13:35:47.318Z"},{"id":"time_of_occurence","value":"15:37:37"}],"comment":"Nice train"}

Categories

Resources