developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 12 years ago

Closed 12 years ago

#635 closed enhancement (fixed)

Add support of the required attribute on <checkbox>

Reported by: bballizlife Owned by: Julien
Priority: normal Milestone: Jelix 1.1 beta 1
Component: jelix:forms Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

On the <checkbox> element, we cannot use the attribute required.

This attribute should be allowed as it could be usefull if you want to create a form with a checkbox user must tick (accept conditions when signin for example).

Attachments (2)

635-jForms-add-support-of-the-required-attribute-on-checkebox.diff (2.2 KB) - added by Julien 12 years ago.
635-jForms-add-support-of-the-required-attribute-on-checkebox.2.diff (7.0 KB) - added by Julien 12 years ago.
updated patch with unit tests and updated relaxNG shcemas

Download all attachments as: .zip

Change History (16)

comment:1 Changed 12 years ago by laurentj

accept conditions when signin for example

Well, if the user doesn't want to accept conditions, this is not an error :-p

Personnally, in this case, I think I would prefer to redirect to another page with a "cancel" message or something like that.

It's strange to me to treat this as an "error"...

But why not..

comment:2 Changed 12 years ago by bballizlife

In this case, accepting conditions (and so ticking the box) is mandatory to access a service. Without that you cannot suscribe.

So the action of ticking a checkbox could be required so as giving a valid email address.

comment:3 Changed 12 years ago by bballizlife

So what about this ticket ? Accepted ? Invalid ?

As i said above, i really think this should be implemented.

comment:4 Changed 12 years ago by bastnic

I also need that for one of my current project.

comment:5 Changed 12 years ago by laurentj

Ok. Make a patch :-)

comment:6 Changed 12 years ago by Julien

  • Owner set to Julien
  • Status changed from new to assigned

I take this one as I need it in the next few days...

comment:7 Changed 12 years ago by Julien

  • review set to review?

Here's the patch.

For the moment, Javascript check doesn't work, but it will as soon as #636 is committed.

I don't know if I should update relaxNG schemas, I'm not very friendly with that. If I should, let me know, I'll try and learn ;)

comment:8 Changed 12 years ago by laurentj

The patch is ok (except the javascript issue), but I really would like to have unit test.

comment:9 Changed 12 years ago by Julien

Ok I'll try writing tests.

What about RelaxNG shemas ? Should I update them in the patch ?

comment:10 Changed 12 years ago by laurentj

  • review changed from review? to review-

yes, you should :-) You'll see, RelaxNG is very easy :-)

Changed 12 years ago by Julien

updated patch with unit tests and updated relaxNG shcemas

comment:11 Changed 12 years ago by Julien

  • review changed from review- to review?

patch to review, with unit tests and updated RelaxNG schemas (hope I've done right with these)

comment:12 Changed 12 years ago by laurentj

  • review changed from review? to review+

It seems ok for me. thanks for the patch :-)

comment:13 Changed 12 years ago by Julien

nice ;)

please take a look at #636, because it should be commited first, so javascript will work here.

Thanks

comment:14 Changed 12 years ago by Julien

  • Resolution set to fixed
  • Status changed from assigned to closed

committed in the trunk

Note: See TracTickets for help on using tickets.