Disable Firefox autocomplete? - forms

For a reason I cannot determine, the password field is being populated when the form is submitted. This only happens in Firefox.
This is my form.
<form action="index.php/admin/settings/account" autocomplete="off" method="post">
<section>
<label for="email">Email</label>
<input type="text" name="email" value="test#test.com" autocomplete="off" />
</section>
<section>
<label for="password">Password</label>
<input type="password" name="password" value="******" autocomplete="off" />
</section>
<section>
<label for="confirm_password">Confirm Password</label>
<input type="password" name="confirm_password" value="******" />
</section>
<section>
<input type="submit" name="save" value="Save" />
</section>
</form>
<script>
console.log($('input[name="password"]').val());
$('form').submit(function(e) {
e.preventDefault();
console.log($('input[name="password"]').val());
});
</script>
As you can see. I have set the autocomplete="off" on both the form and the relevant fields. If I save the form without making changes. Autocomplete doesn't fire.
If I change the email address to an email with a saved password the password is changed when the form is submitted.
This is what I get in the console.
Firefox.
******
123123
Chrome
******
******
Has anyone come across this before? How do I stop this?

Is there a reason you're not setting autocomplete="off" in the confirm password section? It seems to be the only section that you're not explicitly disabling that property.

Related

Why am I getting an error with the SSL handshake 525 with Formspree on my Github pages site here http://volunteer.tcffo.org/#cta?

<!-- Contact Form -->
<form id="contact-form" method="post" action="https://www.formspree.io/tcffo.volunteers#gmail.com">
<div>
<input type="text" name="Name:" id="name" placeholder="Name">
<br>
<input type="email" name="Email:" id="email" placeholder="Email Address" />
<br>
<div><textarea name="Message:" id="help" placeholder="Message"></textarea></div>
<br>
<input type="submit" value="Send">
<input type="hidden" name="_next" value="//tcffo.github.io" />
</div>
</form>
Code is here.
https://github.com/tcffo/tcffo.github.io
You're using the wrong Formspree URL there. It should https://formspree.io/, without the www., that's why.

Mail form not working

I have set a basic mail form in TYPO3 but it doesn't seem to be working.
The installation of TYPO3 I am working on has several sites on it and other existing forms work just fine and don't appear to have any major differences to this new one that doesn't.
When the submit button is clicked the page adds ?tx_form_form[action]=process&cHash=xxx... to the url and does not send any mail or go to redirect page.
This form appears on the home page, and identical form on an internal page works fine...
Anyone know what might be the problem here?
Generated Form Code:
<form enctype="multipart/form-data" method="post" name="id-23" id="field-23" action="http://example.com/?tx_form_form[action]=process&cHash=b34b10df4ff74dac67960e990e130408">
<div>
<input type="hidden" name="tx_form_form[__referrer][#extension]" value="Form" />
<input type="hidden" name="tx_form_form[__referrer][#vendor]" value="TYPO3\CMS" />
<input type="hidden" name="tx_form_form[__referrer][#controller]" value="Frontend" />
<input type="hidden" name="tx_form_form[__referrer][#action]" value="show" />
<input type="hidden" name="tx_form_form[__referrer][arguments]" value="YToxOntzOjU6Im1vZGVsIjthOjA6e319a4f0ce18ed8a7ca3ab5be6c9bc69bc141296c7da" />
<input type="hidden" name="tx_form_form[__trustedProperties]" value="a:1:{s:7:"tx_form";a:5:{s:10:"first_name";i:1;s:9:"last_name";i:1;s:5:"email";i:1;s:8:"postcode";i:1;i:6;i:1;}}bbd972ea3852e6c16fab76a45b46929ac7ab0d52" />
</div>
<ol>
<li class="csc-form-24 csc-form-element csc-form-element-textline">
<label for="field-24">
</label>
<input placeholder="First Name" id="field-24" type="text" name="tx_form_form[tx_form][first_name]" required="required" />
</li>
<li class="csc-form-25 csc-form-element csc-form-element-textline">
<label for="field-25">
</label>
<input placeholder="Last Name" id="field-25" type="text" name="tx_form_form[tx_form][last_name]" required="required" />
</li>
<li class="csc-form-26 csc-form-element csc-form-element-textline">
<label for="field-26">
</label>
<input placeholder="Email" id="field-26" type="text" name="tx_form_form[tx_form][email]" required="required" />
</li>
<li class="csc-form-27 csc-form-element csc-form-element-textline">
<label for="field-27">
</label>
<input placeholder="Postal Code" class="signup-sml" id="field-27" type="text" name="tx_form_form[tx_form][postcode]" />
</li>
<li class="csc-form-28 csc-form-element csc-form-element-submit">
<label for="field-28">
</label>
<input type="submit" id="field-28" value="Submit" name="tx_form_form[tx_form][6]" />
</li>
</ol>
</form>
I don't know if it's related but all that extra spacing in the code has been showing up since upgrading the TYPO3 version...
I had a similar issue with a form not being functional in one website and perfectly OK in another.
Setup: TYPO3 7.6 installation with two websites, each with its own domain, both using the builtin system extension form and the extension realurl.
Issue: Within the first website all forms were functional, within the second submitting the form only resulted in the page being reloaded without any validation or action.
Solution:
(1) Make sure that both websites' starting pages are marked as "Root Page" and that both have domain records defined.
(2) Having realurl setup with automatic configuration, I forced an update by deleting the "realurl_autoconf.php" in the "typo3conf" folder.
(3) Make sure that both websites have the correct realurl configuration within their templates' typoscript setup, e.g.:
config {
prefixLocalAnchors = all
absRefPrefix = http://www.domain.tld/
absRelPath = /
tx_realurl_enable = 1
}
In my case I'd simply forgotten the www in the absRefPrefix for the second website...

How to Add CAPTCHA ControlForm into page

I found CAPTCHA Control in Kentico and it's Types (Simple - Logic - Text) CAPTCHA
Now, how can I add it inside WebZone?
I tried using it as a WebPart but it's not like webparts can be added inside Zone
What Steps Should i Follow?
</div>
<div id="MessageForm">
<div class="feedback_form">
<h2>Feedback</h2>
<div class="feedback_input">
<span>Name</span><input class="text_feedback" type="text" value="" />
</div>
<div class="feedback_input">
<span>Email</span><input class="text_feedback" type="text" value="" />
</div>
<div class="feedback_input">
<span>Subject</span><input class="text_feedback" type="text" value="" />
</div>
<div class="feedback_input Message">
<span>Message</span><textarea class="Message_input" rows="4" cols="50"></textarea>
</div>
<div class="feedback_input">
<input class="send" type="submit" value="" />
<img src="image/Captcha.png" />
<input class="type_Captcha" type="text" value="Enter Captcha ... " />
</div>
</div>
</div>
</div>
That's what i'm trying to do.
Replace the html Code inside my form for this areaZone and put customize webpart if available to do the required function.
You can use out of the box functionality called Forms. See "Creating a new form" in documentation and just add CAPTCHA as one of the fields. Then use On-line form web part on your web site. That's all.

IE Form redirecting to action

I have the following simple form:
<form id="MyForm" action="../webformmailer.php" method="post" >
<input type="hidden" name="subject" value="Submission" />
<input type="hidden" name="redirect" value="../sandbox/123/thanks.html" />
<input type="text" size="20" name="FirstName" />
<input type="text" size="20" name="LastName" />
<input type="text" size="20" name="email" />
<select name="comment">
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
<input type="submit" name="submit" value="submit"/>
</form>
I am redirecting users to a simple 'thanks.html' page after they submit their information. This works well in all browsers except IE 8, which redirects users to the webformmailer.php or the action of the form.
Can anyone point me in the right direction?
Thanks
Inside your action script, process the request and then redirect to thanks.html:
header('Location: ../sandbox/123/thanks.html');
Update: since you don't have control over the action script, and all other browsers work exception IE8, then the problem must be in the way IE8 sends data to the server. Try set enctype="application/x-www-form-urlencoded" and see if it works.

I don't want browser to be able to save login details

I'm making a login form, but I don't want browser to be able to save username & password combination.
Just like PayPal or banks.
I have heard that I could do this by using AJAX & Javascript but I'm so unfamiliar with them, so I need to ask help from you!
<form id="loginform">
<label for="username">Username</label>
<input name="username" type="text" value="" required="required" />
<label for="password">Password</label>
<input name="password" type="password" value="" required="required" />
<input type="button" name="doLogin" value="Login" onclick="login(this.form.username.value,this.form.password.value);" />`
With that login form the browser doesn't ask to save the login combo... but now I just need to know how to send the login info to PHP :P
I am assuming that you require the prevention of things like autoformer (for Firefox). Simply change the names of the various input values to something that is different each time the user loads the form.
As Sunny's link suggest, you can use the autocomplete attribute to prevent the browser from suggesting input for a field. So for your example:
<form id="loginform">
<label for="username">Username</label>
<input name="username" type="text" value="" required="required" autocomplete="off"/>
<label for="password">Password</label>
<input name="password" type="password" value="" required="required" autocomplete="off" />
<input type="button" name="doLogin" value="Login" onclick="login(this.form.username.value,this.form.password.value);" />