Hallo Ich entwickle ein Login und registriere Formular in Magento. Für Formularvalidierung ich diesen Code verwendenVarienForm funktioniert nicht in magento 1.9.2 community edition
var registerForm = new VarienForm('register-form', true);
var loginForm = new VarienForm('login-form', true);
if (this.validator && this.validator.validate()) {
this.form.submit();
}
wenn ich verwende diesen Code in phtml mit Script-Tag ist es funktioniert, aber wenn ich es in js bin setzen und mit der Aufforderung durch xml es nicht funktioniert, hier ist mein xml-Code
<custom_abc_index>
<reference name="root">
<action method="setTemplate">
<template>page/1column.phtml</template>
</action>
</reference>
<reference name="head">
<action method="addItem">
<type>skin_js</type>
<name>js/custom_abc/customLoginRegister.js</name>
</action>
</reference>
<reference name="content">
<block type="custom_abc/custom" name="custom" template="custom_abc/Custom.phtml"></block>
</reference>
</custom_abc_index>
Um zu überprüfen, ob js Laden oder i in nicht setzen alert(), ich das Popup bekam, aber ich weiß nicht, warum die Code-Validierung nicht funktioniert. Jede Hilfe wird spürbar sein.