forms

Can't get post ajax request data python

你离开我真会死。 提交于 2020-01-15 14:26:06
问题 I have html form: <form id = "contactForm"> <input type="text" name="name"></input> <input type="text" name="phone"></input> </form> I have Button and when I click it I am doing ajax post request: $.post( "/send-form", $('#contactForm').serialize() In chrome web inspector I can see that data is sent name=+gfdsfd&phone=89999 This is my backend function I am using Flask,Python: @app.route("/send-form", methods=['POST']) def send_form(): name = phone = email = country = text = None data =

show div on form submit with no redirect

余生颓废 提交于 2020-01-15 12:43:26
问题 I'm using a WordPress sidebar widget to capture email addresses. The thing is, it redirects after form submission. I want the visitor to stay on the page they were on after form submission with just a hidden div giving a successful signup message. I've tried something with javascript like this -- <script type="text/javascript"> function showHide() { var div = document.getElementById("hidden_div"); if (div.style.display == 'none') { div.style.display = ''; } else { div.style.display = 'none';

mod_rewrite is preventing my form to be submitted as desired

笑着哭i 提交于 2020-01-15 12:27:28
问题 I have created a www.example.com and m.example.com. The m.example.com resides inside the htdocs/m/ folder. I am also deleting the '.php' extensions using .htaccess. I am having the below codes on the root directory: RewriteCond %{REQUEST_METHOD} =POST RewriteRule ^ - [L] # Redirect external .php requests to extensionless url RewriteCond %{THE_REQUEST} \s/+(.*?/)?(?:index)?(.*?)\.php[\s?] [NC] RewriteRule ^ /%1%2 [R=302,L,NE] #mobile RewriteCond %{HTTP_HOST} ^m\.example\.com$ [NC] RewriteCond

Angular 6 patchValue Not Setting..sometimes

一世执手 提交于 2020-01-15 12:26:07
问题 I have a basic form shown below. I make a call to an API to grab the user's personal info and I want to fill the form fields with the appropriate values. I have been trying to use patchValue but I cannot get it to work. <form (ngSubmit)="onSubmit" class="example-form" [formGroup]="firstFormGroup" #registerForm="ngForm"> <mat-form-field class="example-full-width"> <input matInput placeholder="Company" formControlName="company" required autofocus> <mat-error *ngIf="firstFormGroup.get('company')

Form elements that aren't styleable

南楼画角 提交于 2020-01-15 12:03:57
问题 Here is the fiddle. I am making custom form elements that aren't styleable. I am wondering what form elements aren't styleable so I can create them a custom one. Current JS/JQuery: $(document).ready(function () { $('ol').hide(); $('#click').click(function () { $(this).toggleClass('down'); $('ol').toggle(); $('.l').click(function () { var l = $(this).html(); $('#click').html(l + ' &blacktriangledown;'); }); }); }); HTML: <div id='click'> &blacktriangledown;</div> <div id='list'> <ol> <li class

Form elements that aren't styleable

孤街醉人 提交于 2020-01-15 12:03:08
问题 Here is the fiddle. I am making custom form elements that aren't styleable. I am wondering what form elements aren't styleable so I can create them a custom one. Current JS/JQuery: $(document).ready(function () { $('ol').hide(); $('#click').click(function () { $(this).toggleClass('down'); $('ol').toggle(); $('.l').click(function () { var l = $(this).html(); $('#click').html(l + ' &blacktriangledown;'); }); }); }); HTML: <div id='click'> &blacktriangledown;</div> <div id='list'> <ol> <li class

jquery ajax call fails and returns error on facebook iframes

冷暖自知 提交于 2020-01-15 10:43:42
问题 I'm trying to add a form to a Facebook page through "Static HTML: iframe tabs" app. I am using jQuery,ajax,php to send the form and recieve success or error. When I run the form outside of Facebook iFrames everything works fine. But, on iFrames I've encountered two problems: AJAX call fails each time. It returns error value and does not pass values. Google chrome gives me "this page has insecure content" here is my ajax call: $.ajax({ type: "POST", url: "send.php", contentType: "application/x

jquery ajax call fails and returns error on facebook iframes

百般思念 提交于 2020-01-15 10:42:09
问题 I'm trying to add a form to a Facebook page through "Static HTML: iframe tabs" app. I am using jQuery,ajax,php to send the form and recieve success or error. When I run the form outside of Facebook iFrames everything works fine. But, on iFrames I've encountered two problems: AJAX call fails each time. It returns error value and does not pass values. Google chrome gives me "this page has insecure content" here is my ajax call: $.ajax({ type: "POST", url: "send.php", contentType: "application/x

Submit with checkbox? No javascript

流过昼夜 提交于 2020-01-15 10:26:10
问题 Is there any way to submit a form when a user clicks on a checkbox? Think of a todo list. When the user clicks on the checkbox, it updates the todo entry in the database saying its done. Can this be done without using javascript? 回答1: You could use an image as a submit button: <input type="image" name="done_5" src="checkbox_unchecked.gif" border="0"> That image would be an unchecked image of course, then reload with a checked version This button would follow the normal form action attribute

Play Framework - Checkbox processing

ε祈祈猫儿з 提交于 2020-01-15 10:15:35
问题 How do I process a checkbox input in Play! Framework? Should I catch the value as a String at the controller? How to get what values are checked by a user? This is the html code of my checkbox #{list items:categories, as:'category'} <tr> <td><input type="checkbox" name="category" id="category-${category.name}" value="${category.id}" /><label for="category-${category.name}"> ${category.name}</label></td> </tr> #{/list} 回答1: I think if you have a List<String> category in your form action, you