? Error

User tests: Successful: Unsuccessful:

avatar frankmayer
frankmayer
3 Dec 2013

...eated

Fixes an issue with fields that have been created dynamically. Prior to this fix, it runs validation even on disabled fields.

In my case this caused trouble with twitter's typeahead.js autocomplete. Though the "tt-hint" input field was disabled, it would be validated, which caused the submit button having to be pressed twice in order to submit the form.

avatar frankmayer frankmayer - open - 3 Dec 2013
avatar frankmayer
frankmayer - comment - 3 Dec 2013

BTW, by which standard to you compress JS, so that I can also commit the compressed version of this fix.

avatar Achal-Aggarwal
Achal-Aggarwal - comment - 3 Dec 2013

By looking at your solution I saw one more flaw. Currently we are not initializing elem basic properties which are added dynamically. So like you modified the validateForm function for disabled attribute. If you get some time please do some initializing like we are doing in validateField function.

avatar frankmayer frankmayer - change - 3 Dec 2013
Labels Added: ? ?
avatar frankmayer
frankmayer - comment - 4 Dec 2013

Was this what you meant?

Also, by what standards do you compress the JS?

avatar Bakual
Bakual - comment - 4 Dec 2013

@frankmayer I had to ask myself and it looks like there is no standard yet for this. YUI compressor and jscompress.com were mentioned as tools.

I think you can use whatever tool you like the most.

avatar frankmayer
frankmayer - comment - 4 Dec 2013

@Bakual Thanks, I'll use default setting then. BTW, where would one look for coding- and other standards for Joomla?

Waiting for confirmation from @Achal-Aggarwal on the proposed change, then I'll do a final commit including the compressed JS.

avatar Bakual
Bakual - comment - 4 Dec 2013
avatar Achal-Aggarwal
Achal-Aggarwal - comment - 4 Dec 2013

@frankmayer Yeah exactly what I was thinking about. Thanks @frankmayer. Now newly added form fields are not validated just at form submit but can be validated individually after a form submit fails.

avatar frankmayer
frankmayer - comment - 4 Dec 2013

Great ! I'll also make a commit for the compressed file, so it's ready to be pulled in.

avatar Bakual
Bakual - comment - 4 Dec 2013

Thanks for the PR. Looks good now.
Since we are still tracking the issues in JoomlaCode, may I ask you to open an item there (http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemBrowse&tracker_id=8103)?
Please also provide testing instructions there and reference this PR. Also post the tracker item here once done.
That would be awesome :smiley:

avatar frankmayer
frankmayer - comment - 4 Dec 2013

@Bakual ok, I opened my first tracker item here: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32886

I hope that's fine.

@Achal-Aggarwal Besides this issue, I am not sure if the behavior of having to hit submit twice might be an indicator of another problem, which is not in this issue's scope.
I normally would expect that if the validation fails, the submit would not be happening after the second or any click. Unfortunately I cannot look into this matter at this time, as I have a ton of work in ongoing projects. Just wanted to let you know.

avatar Bakual
Bakual - comment - 5 Dec 2013

@frankmayer Looks good, thanks!

avatar frankmayer frankmayer - change - 14 Jan 2014
Labels Added: ?
Removed: ?
avatar Bakual
Bakual - comment - 27 Jul 2014

@frankmayer or @Achal-Aggarwal Can you update this PR to staging and resolve the conflitcs? And minize the JS afterwards again.
I can merge it then.
That would be helpful!

avatar Achal-Aggarwal
Achal-Aggarwal - comment - 27 Jul 2014

New PR:#4016

avatar Bakual Bakual - close - 27 Jul 2014
avatar Bakual Bakual - change - 27 Jul 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-07-27 16:55:31
avatar Bakual Bakual - close - 27 Jul 2014
avatar Sophist-UK Sophist-UK - reference | b1d72f6 - 7 Oct 14

Add a Comment

Login with GitHub to post a comment