Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] formValidator for Radio Button

No Warning for Required Radio 08 Jul 2016 13:25 #14192

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
Hi Chef,

Using a Enum Radio type field with the required property checked...

If the user does not fill in this required field, the form will not submit - and there is no warning to say what the trouble is. The user usually thinks the form is broken.

Browser: Firefox 47.0
Environment: JCook Sandbox
Buider: Edge
Embed JS: No
Formstyle: Condensed
JDOM:Plugin
Just call me Chris :)
The administrator has disabled public write access.

No Warning for Required Radio 19 Jul 2016 22:06 #14283

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
I see,
Unfortunalely, the form validator cannot handle it.

see the docs here :
github.com/posabsolute/jQuery-Validation-Engine

Otherwise, to fix it, I could implement another form Validator with more features :
bmauser.github.io/bvalidator/

But it works differently.

Moved in New Functionalities.
Coding is now a piece of cake
The administrator has disabled public write access.

No Warning for Required Radio 16 Aug 2016 13:03 #14449

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
Any progress on this?

We can't really use radio buttons in JCook without it.
Just call me Chris :)
The administrator has disabled public write access.

No Warning for Required Radio 16 Aug 2016 13:09 #14451

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
formValidator is already a Cook extra feature that Joomla do not propose, and so I consider it is less important.
There are other priorities at the moment.
Also because I will maybe rewrite it all in future. I am also waiting some volunter to implement a proper good form validator in Joomla.
Can't tell you more at the moment.

I am sure you can find how to hack it, but I tried and it is difficult. So that's why I decided to relay this lower.
You still can use radio buttons with required, but the validation will be done in PHP.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: organicwebs

No Warning for Required Radio 24 Aug 2016 20:47 #14476

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
If you check the fieldtypes at www.position-relative.net/creation/formV.../demoFieldTypes.html
The radio is properly validated :)
The administrator has disabled public write access.

No Warning for Required Radio 24 Aug 2016 20:49 #14477

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Ok, this is correct.
I don't remember now why.
But what about a bootstrap radio field ?

Moved in tickets.

EDIT : But this do not makes the validator more beautifull.
We still have the same problem.

The day I put my hand in, I hope to come out with something nice. I am quite experienced in javascript.
This only thins is that I don't wan't to code a specific Cook plugin. (for many reasons...) so I prefer to implement a well known solution such as this one.

The best would only to redesign it with CSS and jQuery.
At the moment I am doing others things, but I promise you something.
Coding is now a piece of cake
Last Edit: 24 Aug 2016 20:53 by admin.
The administrator has disabled public write access.

No Warning for Required Radio 24 Aug 2016 20:57 #14479

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
The problem is that the radios are hidden, only the flat buttons are there.
The validator tries to get the position of the hidden input and fails with an error: jquery.validationEngine.js:1507 Uncaught TypeError: Cannot read property 'left' of undefined on line 1507

When you remove the display:none
.radio.btn-group input[type=radio] {
/* display: none; */
}
the red alert will show up.

So, that validation works. It is only the alert which fails with a javascript :)

edit; remove display:none and replace with opacity:0;
Last Edit: 24 Aug 2016 21:00 by Romkabouter.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

No Warning for Required Radio 24 Aug 2016 21:00 #14480

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Wonderfull. K++

You see, I don't have much time for that now, but when someone provides the fix, It can be achieved much faster.
In this case, a little hack in the program.. why not ?
Afterall, Joomla proposes a hacked version of bootstrap, I am gonna do the same for this formValidator.
Coding is now a piece of cake
The administrator has disabled public write access.

No Warning for Required Radio 24 Aug 2016 21:01 #14482

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
You can remove display:none and replace with opacity:0;
That seems to work for me
The administrator has disabled public write access.

No Warning for Required Radio 25 Aug 2016 12:21 #14488

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Fixed.

The fix appears in the css files of your component.
I used 'visibility': 'hidden', instead of opacity.

I think opacity is more for graphical rendering, also I found that with visibility it is more relevant.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.088 seconds

Get Started