Hi,
I've installed for test the latest full package version VirtueMart2.6.12.2 + Joomla_2.5.27 on my server using debian 7, PHP Version 5.4.34-0+deb7u1 and mysql 5.5.40-0+wheezy1.
When I try to register through the cart at the page /index.php/account/editaddresscartBT using IE 11 on win7 I get the error "User name in use" but the registration is completed even if there is not the message "Registration Completed!".
If in the same process I make a mistake (for example I leave a required field blank) and then I click register, the message "required field is missing" appears, then I fill the field and I click register again, this time the registration is completed with no error and the message "Registration Completed!" appears.
Every time i try this process I delete the user from joomla and clear cache/cookies on the browser.
There are no problem with other browser.
The problem happen on older versions too as stated on this topic (http://forum.virtuemart.net/index.php?topic=119373)
I hope for solution, thanks!
edit: Solved in VirtueMart 3.0.0
I just found the reason. We need to prevent the default behaviour of the submit button, because the JS is doing it.
Search in edit.php and edit_address.php for
<button class="button" type="submit" onclick="javascript:return myValidator
change the type to button
<button class="button" type="button" onclick="javascript:return myValidator
hello, I have a similar problem with the registration, when I register with IE, I get redirected to the home page :o :o. This is inconvenient because then the customer must return the cart..., while with firefox or other browser this does not happen and after checking I can continue buying without problems .. thanks
Now i use 2.6.12.2 VM
Thank you!
with your fix the error is gone.
In my particular case (I'm using HTML5 Form Validation) I've removed "f.submit();" from myValidator function instead of changing button type. With this only safari complain (do not register), so with:
<?php if(preg_match('/Safari/i',$_SERVER['HTTP_USER_AGENT']) and !preg_match('/Chrome/',$_SERVER['HTTP_USER_AGENT'])) { ?>
f.submit();
<?php } ?>
I put back "f.submit();" only for safari and all is working!
Thanks again
Thank you for this hint.
If we consider this: http://stackoverflow.com/questions/1357118/event-preventdefault-vs-return-false
Then I think it is even easier. Just let the type be input again (replace the type="button" against type="input") and remove the f.submit();
The return false does the rest.
The safari problem was my fault, now f.submit(); is no more. I tried both with type="input" and with type="submit" and it works with both.
So in the end to solve this error we have just to delete "f.submit();" in myValidator function from the file edit.php and edit_address.php (under the folder /components/com_virtuemart/views/user/tmpl).
I think the solution is this one
//We must return here false, to prevent that the form is sent again. We cannot just return true without using f.submit, because then the task is not set
f.submit();
return false;
because we do before
f.task.value = t; //this is a method to set the task of the form on the fTask.
and the changed task is not in the form sent by the button.