Using Foundation 5 Abide, I have
<form data-abide>
<input type="text" name="name" id="name" pattern="alpha" required />
</form>
And at the end of the page just before the body close tag I have
<script type="text/javascript">
$(document).foundation('abide', 'events');
</script>
On my desktop PC, no matter what I enter in the input field, the Abide tooltip pops up saying it's not valid. On the iPad and iPhone, it doesn't validate anything - just submits no matter what. Anyone else run into this?
Related
I am using a simple form that was taken from one of the Netlify related docs:
<form name="contact" action="/" method="post" data-netlify="true">
<div className="field">
<label htmlFor="name">Name</label>
<input type="text" name="name" id="name" value="dave"/>
</div>
<div className="field">
<label htmlFor="email">Email</label>
<input type="text" name="email" id="email" value="email#email.com" />
</div>
<div className="field">
<label htmlFor="message">Message</label>
<textarea name="message" id="message" rows="6"></textarea>
</div>
<input type="submit" value="Send Message" className="" />
</form>
In using gatsby develop and working with/submitting the form, things seem to work fine. I get no errors and get redirected to the home page as expected.
After deploying the site with Netlify and trying to submit the form, I get the following page error:
In my Netlify backend, the form appears in the console but I cannot/do not receive submissions.
I am using a barebones gatsby-config.js, only incorporating gatsby-source-wordpress and gatsby-plugin-google-analytics.
I also tried adding /no-cache=1 to form action.
Can anybody advise?
It might also be worth noting that I have coded my form as a component and am importing it into my footer as such. In that way, it may be imported multiple times on different pages as mentioned in point 3 of this StackOverflow answer.
Thanks.
I learned that because I'm using Gatsbyjs, and Gatsby + Netlify = javascript forms, I needed to add another input type="hidden" to my form:
<form name="my-form" ... >
<input type="hidden" name="form-name" value="my-form" />
The documentation for this wasn't immediately clear but below are some links that address this:
Here's a link to an article that pointed me to the answer: How to
Integrate Netlify’s Form Handling in a React App
Here's another one if you're building in Vue: How to Integrate
Netlify Forms in a Vue App
And all about Netlify Forms
If you are using any redirect method then you have to add _redirects file in your root folder and add paths to it so that redirect can work.
It's may be confusing but you can visit this link for more help.
I'm new to the Ionic framework, and I'm using Ionic 3.
Even though I use a form in my app, I'm still getting this warning in the browser:
[DOM] Password field is not contained in a form:
Why is that, and how can I fix it?
What is it?*
Chromium project (mostly Google Chrome) wants to change the world and make all passwords, as well as all form data autosaved and autofilled by default. The people behind this decision claim that will make the web safer†. While Firefox also promotes autosaved and autofilled form data, Chrome goes further admonishing web developers to comply with form element scoping that's more convenient for the browser.
At the same time, Google Chrome uses heuristics to determine what a "form" is on the web page and doesn't actually need individual form elements to be wrapped in a <form> element.
Additionally, Google Chrome treats all web pages, all forms and all form fields as if they are filled by the end user, where password is user's own password. A use-case where e.g. company administrator fills in new joiner's initial password is not supported.
The shortened URL in the form takes you to Create Amazing Password Forms page the the Chromium projects. Today the text there is very patronising, thus I'll omit the link.
†I neither claim to agree with Chrome/Chromium, nor claim that Google is in the position to profit from autofill via lock-in or access to user data; that's out of scope.
How can I fix it?
Simple: ignore it.
It's only a notice in developer tools in one of the major browsers.
Solution 1:
I think you are using Chrome browser. If you will try on Mozilla, it will not give the error. Please refer to this link for more details:
https://github.com/aws-amplify/amplify-js/issues/165
Here is the example:
<div className="myform" onSubmit={this.validateLogin()}>
<div className="myformgroup">
<label>Email</label>
<input type="text" placeholder="Email" id="email"></input>
</div>
<div className="myformgroup">
<label>Password</label>
<input type="password" placeholder="Enter the Password" id="mypassword" value=""/>
</div>
<div className="myformgroup">
<button type="submit" id="loginButton">Login</button>
</div>
</div>
Is returning the password field is not contained in a form.
Solution 1:
After changing the master div tag to a form as I have in the following:
<form className="myform" onSubmit={this.validateLogin()}>
<div className="myformgroup">
<label>Email</label>
<input type="text" placeholder="Email" id="email"></input>
</div>
<div className="myformgroup">
<label>Password</label>
<input type="password" placeholder="Enter the Password" id="mypassword" value=""/>
</div>
<div className="myformgroup">
<button type="submit" id="loginButton">Login</button>
</div>
</form>
it will not return the warning.
Solution 2:
Install aws-amplify in your project directory as explained in https://github.com/aws-amplify/amplify-js.
I'm working on a PowerShell solution to scrape some pages in SharePoint (2013) Site Settings and I'm stuck on how to reference a ModalDialog that pops up during the scrape. Any suggestions how to do this?
I'm looking to pull the data from the input boxes and then click "Cancel" to return to the previous page.
The link that calls the modal is:
<td class='ms-authoringcontrols'>
<table cellspacing='0' cellpadding='0' border='0' class='ms-authoringcontrols'>
<a id="ctl00_PlaceHolderMain_editBB1" onclick="OpenBestBet('https:\u002f\u002www.example.com\u002fsites\u002fusa\u002fproductqualitysupport\u002fPages\u002fdefault.aspx'); return false;" href="#BestBet">Edit</a>
</table>
</td>
The JS function that opens the modaldialog is:
function OpenBestBet(bestBetUrl)
{
// make up the url to send to the BestBet page
bestBetUrl = bestBetUrl?escapeProperly(bestBetUrl):bestBetUrl;
var addedBestBets = document.forms[0].elements['ctl00_PlaceHolderMain_bestBet'].value ;
var keyword = escapeProperly(document.forms[0].elements['ctl00_PlaceHolderMain_keyword'].value);
var gotoUrl =
addQueryParametersToUrl('BestBet.aspx',['u','k','a'],[bestBetUrl,keyword,addedBestBets]);
var dialogOptions = {width:500, height:450};
SP.SOD.executeFunc('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', function() { SP.UI.ModalDialog.commonModalDialogOpen(gotoUrl,dialogOptions,AddBestBetCallback,[addedBestBets]); });
}
This is what it looks like on the page:
And the body tag of the modaldialog starts with:
<body>
<form method="post" action="BestBet.aspx?u=https%3a%2f%2fwww.example.com%2fsites%2fusa%2fproductsupport%2fPages%2fdefault.aspx&k=PQSS&IsDlg=1" onsubmit="javascript:return WebForm_OnSubmit();" id="BestBet">
<div class="aspNetHidden">
<input type="hidden" name="__REQUESTDIGEST" id="__REQUESTDIGEST" value="0xOBFUSCATED,29 Aug 2014 20:57:46 -0000" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/OBFUSCATED=" />
</div>
<script type="text/javascript">
//<![CDATA[
I'm using PowerShell 3.0, Net.WebClient, application.internetexplorer object, and also have HtmlAgilityPack but I'm not able to figure out how to reference the modaldialog. Any help would get great! Thanks
Ultimately, I was able to open and close the Modal window in Selenium but didn't take the time to figure out how to scrape values from it using Selenium.
Using PowerShell I wasn't able to access any part of the Modal, but when checking the source code of the Modal window I noticed the full URL in the header and was able to construct the URL from information on the parent page. This allowed me to launch another IE instance in PS, open the URL not in Modal mode, scrape the content, and close the window.
The URL construction was a little tricky with Unicode encoding and URI Data encoding, but I got it worked out. I hope others find this helpful.
Welcome to episode 32,342,343 of "Why does Internet Explorer Suck So Much?"...
I've seen lots of reports that IE9 does a crappy job uploading files. Apparently it has lots of caveats about when it will or won't work (If someone has a definitive list I'd love to see it). However, most of the problems/solutions I see have found are related to javascript, usually the jQuery form plugin or something similar.
My form is not submitted via AJAX and the the file input field is not hidden or obscured with css. Yet, I get several support tickets per day from users on IE9 trying to submit the form and "nothing happens" (=the form submits. No errors, but the file is not uploaded.) I haven't gotten a single complaint with a different browser, and IE8 even seems to work (as well as it ever does).
Here's the top of my form. Am I missing something?
<form action="http://mysite.dev/account-settings/?open=resume" method="post" class="wpjb-form" enctype="multipart/form-data">
<input type="hidden" name="resume_form" value="resume_form" />
<fieldset class="wpjb-fieldset-default">
<input id="firstname" name="firstname" type="hidden" class="regular-text " value="John" />
<input id="lastname" name="lastname" type="hidden" class="regular-text " value="Henry" />
<input id="email" name="email" type="hidden" class="regular-text " value="john.henry#johnhenry.com" />
<div class="wpjb-element-input-checkbox wpjb-element-name-is_active">
<label class="wpjb-label">Show resume? </label>
<div class="wpjb-field">
<label for="is_active_1"><input type="checkbox" class="" name="is_active" id="is_active_1" value="1" checked="checked" /> Yes <small style="display:inline;">(Uncheck to hide your resume)</small></label>
</div>
</div>
<div class="wpjb-element-input-select-one wpjb-element-name-file">
<label class="wpjb-label">Upload a <i>new</i> resume file</label>
<div class="wpjb-field">
<input style="line-height:1em;" id="file" name="file" type="file" class="regular-text " />
<small class="wpjb-hint">Accepted file types: doc, docx, odf, pdf, rtf</small>
</div>
</div>
</fieldset>
...
It goes on like this with a couple more <fieldset>s then ends like this:
....
<p class="submit">
<input type="submit" name="Submit" id="wpjb_submit" value="Save Changes" />
</p>
</form>
Update
I'm happy for everyone who has never experienced this problem but it's not just me:
http://answers.microsoft.com/en-us/ie/forum/ie9-windows_vista/cannot-upload-files-using-internet-explorer-9/5724d921-ae71-e011-8dfc-68b599b31bf5
Update2
I'm seeing a lot of suggestions to add a meta tag to force the user agent to IE8...
<meta http-equiv="X-UA-Compatible" content="IE=8" />
I don't want to do this because although I do support IE8, many of the elements on my site render differently in IE8 vs. IE9. This would create a rather sloppy user experience as any IE users would experience I temporary "time warp" back to IE8 on that specific page.
I was able to fix this nightmare of a problem by wrapping a jQuery form submit in a setTimeout:
$('#complete_profile input[type="submit"]').click(function(){
setTimeout(function() {
$('#complete_profile form').submit();
}, 0);
});
This may cause duplicate submission when the form DOES submit, however, so be careful.
As Graham does, I think that this might more be a server issue - also I have never had issues with fileuploads in IE9 (or newer) - I guess you don't want to post the code of the PHP Script that handles the upload?
if any data is not being sent, You could check the post data by your hidden input on your server side script. For example if you're using php it would be something like
<? if($_POST['resume_form']=='resume_form'){
//Do something
} ?>
Or you could also use meta compatible tags for IE to render the page like IE8
<meta http-equiv="X-UA-Compatible" content="IE=8" />
I suggest setting the X-UA-Compatible meta tag value and seeing whether that makes any difference.
See this question for possible values: What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?
It may also be that the page is triggering a non-standards mode in IE9. I suggest opening the page in IE9, opening the developer tools, and seeing which browser/document modes are selected. That may give you a clue. Note that the "enctype" form attribute was not supported prior to IE8, so if the browser is using an older doc mode, that attribute is not being recognized.
OK I'd rather leave a comment not an answer but I don't have the points for that yet!
Are the users in quirks mode? Most IE users are unaware of the quirks mode and may have accidentally clicked it when trying to refresh the page (instead of pressing F5). If it is intermittent this could be the reason why.
following on from above.. On the server side how are you checking for empty fields? I'm more on the lines of JS here where you often look for "", null and undefined I'm just thinking that perhaps the quirks mode is sending some fuzzy data that your server side error checking is missing because you aren't looking for it and hence reports all is OK.
I'm working with a Classic ASP site and having a bit of a conundrum... my form works perfectly in IE, but in Chrome, Opera, and Firefox I can't click anything within the form - I can't type or even get a cursor to show up in the input fields, the link isn't clickable and neither is the button. The mouse pointer doesn't even change on mouseover of any of those elements.
The doctype is HTML 4.01 Strict, and I have validated it with the W3 validator. The links in the page's header and footer are clickable as normal.
<form name="esi" method="post" action="employeehome.asp">
<p>
<label for="empid" class="achtung">Employee ID:</label><br>
<input type="text" name="empid" size="20" maxlength="30">
</p>
<p>
<label for="emppw" class="achtung">Password:</label><br>
<input type="password" name="emppw" size="20" maxlength="20"><br>
Password Recovery
</p>
<p>
<input type="hidden" name="empstatus" value="1">
</p>
<p class="submitbuttonspace">
<input type="submit" value="Sign In">
</p>
</form>
There is nothing wrong with this form example. I just tested it on my server. No errors and nothing to disable anything.
You must have something else crashing your browser.