Skip to content
Code-Schnipsel Gruppen Projekte
Commit 1d4220c4 erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

fix: Do not create send button in javascript by onImport -> sporadic problem with locale.

Übergeordneter 00a8237a
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -53,37 +53,34 @@ define('package/quiqqer/bricks/bin/Controls/SimpleContact', [
this.Loader.inject(this.$Elm);
this.Form = this.$Elm.getElement('form');
var Button = new Element('button', {
'class': 'quiqqer-simple-contact-button',
'type' : 'button',
'html' : QUILocale.get('quiqqer/bricks', 'control.simpleContact.sendButton'),
events : {
click: function () {
if (self.$captchaRequired && !self.$captchaResponse) {
QUI.getMessageHandler(function (MH) {
MH.options.displayTimeMessages = 2000;
var CaptchaElm = self.$Elm.getElement('.qui-contact-captcha');
if (!CaptchaElm) {
CaptchaElm = undefined;
}
MH.addError(
QUILocale.get(lg, 'brick.control.simpleContact.error.captcha_failed'),
CaptchaElm
);
});
return;
}
var Button = this.Form.getElement('.quiqqer-simple-contact-button');
if (Button) {
Button.addEvent('click', function () {
if (self.$captchaRequired && !self.$captchaResponse) {
QUI.getMessageHandler(function (MH) {
MH.options.displayTimeMessages = 2000;
var CaptchaElm = self.$Elm.getElement('.qui-contact-captcha');
if (!CaptchaElm) {
CaptchaElm = undefined;
}
MH.addError(
QUILocale.get(lg, 'brick.control.simpleContact.error.captcha_failed'),
CaptchaElm
);
});
self.$Elm.getElement('form').fireEvent('submit');
return;
}
}
});
Button.inject(this.Form);
self.$Elm.getElement('form').fireEvent('submit');
});
Button.removeAttribute('disabled');
}
this.$Elm.getElement('form').addEvent('submit', function (event) {
if (typeof event !== 'undefined') {
......
......@@ -23,6 +23,13 @@
{/if}
<form class="quiqqer-simple-contact" method="POST" action="">
<noscript>
<style>
.quiqqer-simple-contact-button__hideOnNoScript {
display: none !important;
}
</style>
</noscript>
{if $this->getAttribute('labels')}
<label for="qui-contact-name">
......@@ -115,6 +122,10 @@
{$CaptchaDisplay->create()}
{/if}
<button class="quiqqer-simple-contact-button quiqqer-simple-contact-button__hideOnNoScript" type="submit" disabled="disabled">
{locale group='quiqqer/bricks' value='control.simpleContact.sendButton'}
</button>
<noscript>
<input class="quiqqer-simple-contact-button" type="submit"
value="{locale group='quiqqer/bricks' value='control.simpleContact.sendButton'}" />
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren