Note that there are some explanatory texts on larger screens.

plurals
  1. POTrouble with colorbox and jQuery validation in WebKit browsers
    primarykey
    data
    text
    <p>I'm using JQuery 1.4.2 with Colorbox(<a href="http://colorpowered.com/colorbox/" rel="nofollow">http://colorpowered.com/colorbox/</a>) and Validation(<a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" rel="nofollow">http://bassistance.de/jquery-plugins/jquery-plugin-validation/</a>) plugins in my project. I've got problem in Chrome(10.0.648.127 beta) and Safari(5.0.1) - content of my modal window don't refresh after validation. What i mean is that, when I enter wrong value in form(which is in this modal window), and validate it, error message doesn't appear. Validation is working, because i see in console, that valid() method returns good values. And when I close my modal, and open it again (without refreshing page), then I see error message. And of course to make it dissapear, i have to type in good value, and agian close&amp;open again my modal window. </p> <p>In Firefox 3.6.13, Opera 11.01 and IE9 RC everything is OK.</p> <p>My JS code:</p> <pre><code>$.colorbox({ width: 1000, scrolling: false, inline: true, href: '#userForm', onComplete: function() { $('#userForm').validate({ rules: { name: { minlength: 4, required: true, remote: "ajax/ajaxUsers.php?ajaxMode=userExists" }, pass: { minlength: 6, required: true }, pass_2: { equalTo: "#i_pass" }, email: "email" }, messages:{ name: { minlength: 'Nazwa użytkownika powinna mieć conajmniej {0} znaki', required: "Nazwa użytkownika jest wymagana", remote: "Ta nazwa jest już zajęta" }, email: "Proszę wpisać prawidłowy adres email", pass:{ minlength: 'Hasło powinno mieć conajmniej {0} znaków', required: "Proszę wpisać hasło" }, pass_2: "Proszę powtórz hasło z powyższego pola" }, errorClass: "invalid", errorElement: "em" }); } }); </code></pre> <p>My HTML:</p> <pre><code>&lt;div class="hidden"&gt; &lt;div id="userFormDialog" class="dialog"&gt; &lt;div class="dialogHeader"&gt; &lt;h2 class="modalButton"&gt;Dodaj Nowego Użytkownika&lt;/h2&gt; &lt;/div&gt; &lt;div class="dialogContent"&gt; &lt;form class="adminForm" action="users.php?act=add" method="post" id="userForm"&gt; &lt;div class="col1"&gt; &lt;fieldset&gt; &lt;legend&gt;Dane podstawowe:&lt;/legend&gt; &lt;p&gt;&lt;label for="i_name"&gt;Nazwa użytkownika*&lt;/label&gt;&lt;input type="text" name="name" id="i_name" placeholder="Nazwa użytkownika" autofocus&gt;&lt;/p&gt; &lt;p&gt;&lt;label for="i_fullname"&gt;Pełna nazwa&lt;/label&gt;&lt;input type="text" name="fullname" id="i_fullname" placeholder="Pełna nazwa"&gt;&lt;/p&gt; &lt;p&gt;&lt;label for="i_email"&gt;Adres email&lt;/label&gt;&lt;input type="email" name="email" id="i_email" placeholder="Adres email"&gt;&lt;/p&gt; &lt;p&gt;&lt;input type="checkbox" name="status" id=i_status&gt;&lt;label for="i_status"&gt;Aktywny?&lt;/label&gt;&lt;/p&gt; &lt;/fieldset&gt; &lt;fieldset&gt; &lt;legend&gt;Autoryzacja&lt;/legend&gt; &lt;p&gt;&lt;label for="i_pass"&gt;Hasło*&lt;/label&gt;&lt;input type="password" name="pass" id="i_pass" placeholder="Hasło"&gt;&lt;/p&gt; &lt;p&gt;&lt;label for="i_pass_2"&gt;Powtórz hasło*&lt;/label&gt;&lt;input type="password" name="pass_2" id="i_pass_2" placeholder="Powtórz hasło"&gt;&lt;/p&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;div class="col2"&gt; &lt;fieldset&gt; &lt;legend&gt;Dostęp do Fotoware&lt;/legend&gt; &lt;p&gt;&lt;label for="i_fw_u"&gt;Użytkownik Fotoware&lt;/label&gt;&lt;input type="text" name="fw_u" id="i_fw_u" placeholder="Użytkownik Fotoware"&gt;&lt;/p&gt; &lt;p&gt;&lt;label for="i_fw_p"&gt;Hasło Fotoware&lt;/label&gt;&lt;input type="password" name="fw_p" id="i_fw_p" placeholder="Hasło Fotoware"&gt;&lt;/p&gt; &lt;/fieldset&gt; &lt;fieldset class="accessLevel"&gt; &lt;legend&gt;Poziom dostępu&lt;/legend&gt; &lt;label for="i_level"&gt;Wybierz poziom dostępu&lt;/label&gt;&lt;select name="level" id="i_level"&gt; {foreach $userLevels as $level} &lt;option value="{$level@key}"&gt;{$level}&lt;/option&gt; {/foreach} &lt;/select&gt; &lt;ul&gt; {foreach $userPermissions as $perm} &lt;li&gt;&lt;input type="checkbox" name="permissions[]" id="i_permissions" value="{$perm@key}"&gt;&lt;label for="i_permissions"&gt;{$perm}&lt;/label&gt;&lt;/li&gt; {/foreach} &lt;/ul&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;/form&gt; Pola oznaczone gwiazdka są obowiązkowe. &lt;/div&gt; &lt;div class="dialogFooter"&gt; &lt;button class="modalButton" id="submitUserButton"&gt; Zapisz &lt;/button&gt; &lt;button class="modalButton closeDialog"&gt; Anuluj &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p></p> <p>Any ideas why does it happen that way?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload