Magento Forum

   
SOLVED:  Unable to type in input field after validation error
 
SheriUSA
Jr. Member
 
Total Posts:  15
Joined:  2010-06-22
 

I sure hope someone can help me…

If I leave some of the input fields that are required empty on some of my forms (i.e.:  Add New Address, Account Information, Edit Address, Share Your Wishlist, etc.), the validation will trigger that there is an error in the form.  That works good.  While the field is highlighted and stating that I need to fill it out, I cannot enter any text.  The entire field is not enabled, nor is any other field that is highlighted enabled.  The fields that were filled out just fine are enabled, though.  The only way for the average user to enable these fields is to refresh the page. 

I’m thinking that all of the forms in the My Account area have this problem.  The forms that are outside the account, like Login, Create New Account, Send Email to a Friend, Review Product, etc, all seem to work properly and are enabled when there are validation errors.

When I go to my Firefox Web Developer extension and check the enable form fields button, the account forms all work just fine while being highlighted. 

I have not altered the javascript at the bottom of the template files.  The javascript appears to be correct, and I’m not getting any javascript errors. 

An example for add new address:
var dataForm = new VarienForm(’form-validate’, true);
new RegionUpdater(’country’, ‘region’, ‘region_id’, <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, ‘zip’);

I am using Magento 1.7

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
jeffcustom
Member
 
Avatar
Total Posts:  67
Joined:  2012-11-29
Boulder, CO
 

So, do the fields have disabled=’true’ in them, or can you simply not enter any text?

I’m wondering if the validation divs are covering the input box, or if there’s something wrong with the version of js/varien/form.js

 
Magento Community Magento Community
Magento Community
Magento Community
 
SheriUSA
Jr. Member
 
Total Posts:  15
Joined:  2010-06-22
 

I don’t know if the fields have disable=’true’.  Where would you find this?  I for sure cannot enter any text.  Even the cursor does not acknowledge that there is anything there.

I doubt there is anything wrong with the varien/form.js file.  It seems to be working with all of the other forms that are outside of the Account section.  When I installed 1.7, I did a brand new install - not an upgrade.

As for the divs, I haven’t changed any of the div id’s or classes.  The validation is working and is pointing out that the fields need to be filled with data before submitting.  The form is just not enabling those fields to be corrected with out being totally refreshed.

I’m not sure I answered your questions, but thanks for your input anyway.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ryan Sun _Kuafu
Guru
 
Total Posts:  317
Joined:  2008-11-14
FL
 

did you try with magento default theme?

 
Magento Community Magento Community
Magento Community
Magento Community
 
SheriUSA
Jr. Member
 
Total Posts:  15
Joined:  2010-06-22
 

I checked the default theme and sure enough it works just fine.  No problems with the input fields after a validation error.  I’m trying to locate the problem between the two themes.  Any thoughts?

I do not have a jquery conflict, either.

Thank you for your help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ryan Sun _Kuafu
Guru
 
Total Posts:  317
Joined:  2008-11-14
FL
 

--delete--

 
Magento Community Magento Community
Magento Community
Magento Community
 
SheriUSA
Jr. Member
 
Total Posts:  15
Joined:  2010-06-22
 

Deleting the theme is not an option.  Good grief; everything is done and working except for this problem.  At this point I’m going through the files to see where I went wrong.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ryan Sun _Kuafu
Guru
 
Total Posts:  317
Joined:  2008-11-14
FL
 

LOL I was indicating my post was deleted.
It might be something wrong with js failed to toggle disabled attribute back and forth.
Did you see and js error in firebug console panel?

 
Magento Community Magento Community
Magento Community
Magento Community
 
SheriUSA
Jr. Member
 
Total Posts:  15
Joined:  2010-06-22
 

Ha, ha, ha… sorry for accusing you.

There are no javascript errors in Firebug or Web Developer. 

I did notice that under the Firebug DOM tab it says IsContentEditable = false.

 
Magento Community Magento Community
Magento Community
Magento Community
 
SheriUSA
Jr. Member
 
Total Posts:  15
Joined:  2010-06-22
 

I found out my problem.  I went to Firebug and Web Developer and found that there were no javascript errors.  In Web Developer, I viewed all of the javascript on one of the forms that I was having problems with, and then I viewed the javascript with the default theme to see what the differences were.  I had some extra javascript that was embedded in the page from a sidebar block that was affecting the overall page.  Once I deleted that, ba-da-bing, it all works well.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rajatsri88
Jr. Member
 
Total Posts:  3
Joined:  2013-07-21
 

I also have a similar validation error not being corrected without page refresh..
Can u please provide the javascript code which u deleted to rectify this problem..
Thanks..

 
Magento Community Magento Community
Magento Community
Magento Community
 
SheriUSA
Jr. Member
 
Total Posts:  15
Joined:  2010-06-22
 

It’s been so long ago that I don’t remember what the code was.  Like I said before, I compared my current theme code with the Magento default code and found there was additional javascript code in one of my sidebar blocks of my theme.  I deleted the extra code, and all worked out perfectly.

Good luck, and I’m sure you will find your javascript problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rajatsri88
Jr. Member
 
Total Posts:  3
Joined:  2013-07-21
 

Thanks.. Was the JS in varien/form.js?
I am new in Magento.. This issue is urgent..
Your help is required..
Thanks..

 
Magento Community Magento Community
Magento Community
Magento Community
 
SheriUSA
Jr. Member
 
Total Posts:  15
Joined:  2010-06-22
 

No, I did not change the varien javascript. 

From what I remember it was some javascript that was embedded in one of the sidebar block files.  I looked at the forms that were being affected, and then I looked at all of the files that make up those pages.  To do so, go to System-> Configuration-> Advanced-> Developer-> Debug-> Template Path Hints and change that to yes.  You need to be sure that your current configuration scope up in the left corner is set properly (i.e.: English).  When you refresh the page, you will see all of the files that make up that page.  I started to look at the files that were most likely to be the culprit.  For example, if your forms were working properly only a week or so ago, and since then you have installed an extension - then look at that extension first.  In my case, I had a sidebar block that I knew was not native to Magento, and everything else on the page was native - so I went there first.  Sure enough, that sidebar block had some javascript embedded in one of the phtml files that not only wasn’t needed, but actually causing problems.  On its own, the javascript is fine, and that is why I wasn’t getting any errors from Firebug or Web Developer. 

I hope this is as clear as mud.

 
Magento Community Magento Community
Magento Community
Magento Community
 
SheriUSA
Jr. Member
 
Total Posts:  15
Joined:  2010-06-22
 

Also...like I said above:

“I found out my problem.  I went to Firebug and Web Developer and found that there were no javascript errors.  In Web Developer, I viewed all of the javascript on one of the forms that I was having problems with, and then I viewed the javascript with the default theme to see what the differences were.  I had some extra javascript that was embedded in the page from a sidebar block that was affecting the overall page.  Once I deleted that, ba-da-bing, it all works well. “

In this case, I used Web Developer which is an add-on with Mozilla Firefox.  I find Web Developer to be a great tool like Firebug or Chrome’s Web Developer Tools.  If you have Web Developer, under the Information tab, there is a “View Javascript\” option.  I clicked on that while viewing the page that was showing my form problem, and then compared that to using Magento’s Default theme and viewing the javascript on that page.  I could then see the differences, and then go to the file that was the problem.

By the way, this is what you should do first, and then go to template paths (if need be).  This is assuming that you have already tested Magento’s default theme, and it shows that there is no problem with the default theme and there is a problem with your theme.

Again, when you look over the javascript, focus on the areas that are not native to Magento’s Default theme.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top