bind input to xsd:date to get datepicker but forbid text input?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

bind input to xsd:date to get datepicker but forbid text input?

Ken Yap-2
What I would like to do is provide an input field that provides a
datepicker widget to enter the date. I can get this by binding to
xsd:date. But I would also like to disallow users from typing in the
date, I want them to only go through the datepicker. Then I don't have
to handle invalid input and all that. If I understand the read-only
attribute this would prevent even the use of the datepicker to change
the field, am I correct? Is there a way to get what I want?
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: bind input to xsd:date to get datepicker but forbid text input?

Philipp Wagner-4
Ken Yap schrieb:
> What I would like to do is provide an input field that provides a
> datepicker widget to enter the date. I can get this by binding to
> xsd:date. But I would also like to disallow users from typing in the
> date, I want them to only go through the datepicker. Then I don't have
> to handle invalid input and all that. If I understand the read-only
> attribute this would prevent even the use of the datepicker to change
> the field, am I correct? Is there a way to get what I want?

You don't have to handle invalid input either way, if you provide a
schema which requires a xsd:date for the field, it will be validated
before submit preventing invalid inputs.

Philipp
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: bind input to xsd:date to get datepicker but forbid text input?

Klotz, Leigh
No matter what a well-written user agent should do, the server should
always check its input:  http://xkcd.com/327/

You needn't handle it prettily; simply responding 404 Forbidden or 500
Internal Error if you're not feeling charitable.

You never know what's on the other end of the wire; it might not be
Firefox:

http://en.wikipedia.org/wiki/On_the_Internet,_nobody_knows_you're_a_dog

Leigh.
 

-----Original Message-----
From: dev-tech-xforms-bounces+leigh.klotz=[hidden email]
[mailto:dev-tech-xforms-bounces+leigh.klotz=[hidden email]]
On Behalf Of Philipp Wagner
Sent: Wednesday, May 28, 2008 11:29 AM
To: [hidden email]
Subject: Re: bind input to xsd:date to get datepicker but forbid text
input?

Ken Yap schrieb:
> What I would like to do is provide an input field that provides a
> datepicker widget to enter the date. I can get this by binding to
> xsd:date. But I would also like to disallow users from typing in the
> date, I want them to only go through the datepicker. Then I don't have

> to handle invalid input and all that. If I understand the read-only
> attribute this would prevent even the use of the datepicker to change
> the field, am I correct? Is there a way to get what I want?

You don't have to handle invalid input either way, if you provide a
schema which requires a xsd:date for the field, it will be validated
before submit preventing invalid inputs.

Philipp
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: bind input to xsd:date to get datepicker but forbid text input?

Ken Yap-2
In reply to this post by Philipp Wagner-4
Ok, ok, I will handle invalid input to keep the data sane. But what
about the first part of my question? Can I prevent users typing in
input and make them go through the datepicker? That doesn't seem to be
possible. The best I can do is shrink the input size to 0 which still
leaves an ugly small box with a drop-down arrow for the datepicker. It
seems that this calls for an @appearance setting for datepicker for
inputs of type xsd:date.

Now you will say, now that you have handled invalid input it shouldn't
matter tnat you have an input box. It's really a question of reducing
the chance of user error. All the dates will be in the near future so
it doesn't matter that they have to go through a couple of months
clicks first. And often users forget the date is in yyyy-mm-dd format.
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: bind input to xsd:date to get datepicker but forbid text input?

Klotz, Leigh
Ken,

I think that to solve this problem correctly you need to solve it at a
couple of levels.  

On the server side, the data handling should be keep the data sane, just
as you say.

The UI side should make the experience smooth for the user.

So you're right, I've only helped by pointing out the levels, and not at
all helped on your question about what to do at the presentation level.

XForms will help with some of the UI work, but XForms isn't CSS (though
it can use it), and CSS can't do everything anyway.  If you're using
Mozilla/Firefox only, you have XBL at your disposal.  Loosely put, XBL
is an implementation langauge for adding presentation and behaviors to
markup.  It can bind to markup kind of like CSS, but it lets you
implement the presentation and behaviors which are declared by the
markup.

It so happens that XForms in Firefox uses XBL as a major part of its
implementation strategy, and as you noticed, the @appearance attribute
on input bound to xsd:date does have an influence on the presentation
and behavior of the input control.  

So, try the three standard values of appearance and see if one does what
you want.  If it doesn't, then you can customize appearance with your
own qname (e.g., appearance="my:pickeronly"), and then you can include a
CSS file uses the CSS selector
 
xf:input[@appearance="my:pickeronly"][mozType|typelist~="http://www.w3.o
rg/2001/XMLSchema#date"]

to bind your custom XBL implementation of a date picker only with no
typein box.

You'll have the XHTML+XForms markup expressing the intent (it's a date,
it's an input, it's not readonly), the instance expressing the data
(2008-05-01), and the CSS+XBL expressing the fine points of the
appearance and behavior (no box here, pulldown calendar there), and
finally, you'll have protection from little Bobby Tables on the server
side.

So, try the three standard values of appearance and see if one does what
you want; it just might.  If not, take a look at
http://developer.mozilla.org/en/docs/XForms:Custom_Controls and
http://en.wikibooks.org/wiki/Talk:XForms/Formatting_a_date which is a
counterpoint to http://en.wikibooks.org/wiki/XForms/Formatting_a_date 

By the way, the XForms Recommendation says that xf:output bound to a
date ought to localize it...so the Talk:XForms entry supports that
requirement.

Leigh.

-----Original Message-----
From: dev-tech-xforms-bounces+leigh.klotz=[hidden email]
[mailto:dev-tech-xforms-bounces+leigh.klotz=[hidden email]]
On Behalf Of Ken Yap
Sent: Wednesday, May 28, 2008 4:13 PM
To: [hidden email]
Subject: Re: bind input to xsd:date to get datepicker but forbid text
input?

Ok, ok, I will handle invalid input to keep the data sane. But what
about the first part of my question? Can I prevent users typing in input
and make them go through the datepicker? That doesn't seem to be
possible. The best I can do is shrink the input size to 0 which still
leaves an ugly small box with a drop-down arrow for the datepicker. It
seems that this calls for an @appearance setting for datepicker for
inputs of type xsd:date.

Now you will say, now that you have handled invalid input it shouldn't
matter tnat you have an input box. It's really a question of reducing
the chance of user error. All the dates will be in the near future so it
doesn't matter that they have to go through a couple of months clicks
first. And often users forget the date is in yyyy-mm-dd format.
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: bind input to xsd:date to get datepicker but forbid text input?

Ken Yap-2
In reply to this post by Ken Yap-2
Thanks for the excellent suggestions Leigh.

appearance="minimal" and "compact" didn't do anything, but "full" put
up just a datepicker, but no way of turning it off. So it was more and
also less than I wanted.

I'm reluctant to delve into XBL at the moment, so I did what I could
with styling. This is what I came up with. I display the date with
xf:output for feedback. Now I have to figure out how to suppress the
xf:output when @special is true. Reading about xf:group, and trying to
work it out.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/
2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/
1999/xlink">
  <head>
    <title>Date form</title>
    <xf:model id="model">
      <xf:instance id="state">
        <state xmlns="">
          <date special="true">2008-01-01</date>
        </state>
      </xf:instance>
      <xf:bind nodeset="date/@special" type="xsd:boolean" />
      <xf:bind nodeset="date" type="xsd:date" relevant="not(boolean-
from-string(@special))" />
    </xf:model>
    <style type="text/css">
@namespace xf {"http://www.w3.org/2002/xforms"};
.datefield .xf-value {width:0pt}
    </style>
  </head>
  <body>
    <xf:input ref="date/@special">
      <xf:label>See submission instructions</xf:label>
    </xf:input>
    <xf:input ref="date" incremental="true" appearance="minimal"
class="datefield">
      <xf:label>Date</xf:label>
    </xf:input>
    <xf:output value="date" />
  </body>
</html>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: bind input to xsd:date to get datepicker but forbid text input?

Ken Yap-2
Sorry, I forgot to describe how it looks. There is a tiny type-in box
to the left of the dropdown arrow, which I could live with. Users can
still type invalid input into the field if they focus on it and it
will update in the output. I don't think users will want to do a silly
thing like that, but I catch invalid input later anyway.
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: bind input to xsd:date to get datepicker but forbid text input?

Klotz, Leigh
In reply to this post by Ken Yap-2
Ken,

I think you've highlighted a second issue, which has gone unnoticed (at
least I didn't notice it).  Have you tested and found that users can
type in non-date text into the input field and press submit and it
submits?  If so, that's simply a bug and should get filed in bugzilla.

Now, onto the appearance.  It seems reasonable to ask that one of the
apperanaces of input bound to date offer just a typein field, and that
another offer just a date picker, and that another offer both.  If
there's no current appearance for minimal and compact other than typein,
perhaps we can propose this:

1. xf:input/@appearance="minimal"
Typein field only. (Must validate, of course.)

2. xf:input/@appearnce="compact"
Date picker only.

3. xf:input/@appearance="full"
Typein field and date picker, perhaps with some clicks to get from one
to another, but perhaps not.

It may be that we can work together to write the XBL to do this and
suggest it for incorporation, if it turns out 1/2/3 is what is the right
thing to do.

Leigh.

-----Original Message-----
From: dev-tech-xforms-bounces+leigh.klotz=[hidden email]
[mailto:dev-tech-xforms-bounces+leigh.klotz=[hidden email]]
On Behalf Of Ken Yap
Sent: Wednesday, May 28, 2008 6:17 PM
To: [hidden email]
Subject: Re: bind input to xsd:date to get datepicker but forbid text
input?

Thanks for the excellent suggestions Leigh.

appearance="minimal" and "compact" didn't do anything, but "full" put up
just a datepicker, but no way of turning it off. So it was more and also
less than I wanted.

I'm reluctant to delve into XBL at the moment, so I did what I could
with styling. This is what I came up with. I display the date with
xf:output for feedback. Now I have to figure out how to suppress the
xf:output when @special is true. Reading about xf:group, and trying to
work it out.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/
2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/
1999/xlink">
  <head>
    <title>Date form</title>
    <xf:model id="model">
      <xf:instance id="state">
        <state xmlns="">
          <date special="true">2008-01-01</date>
        </state>
      </xf:instance>
      <xf:bind nodeset="date/@special" type="xsd:boolean" />
      <xf:bind nodeset="date" type="xsd:date" relevant="not(boolean-
from-string(@special))" />
    </xf:model>
    <style type="text/css">
@namespace xf {"http://www.w3.org/2002/xforms"};
.datefield .xf-value {width:0pt}
    </style>
  </head>
  <body>
    <xf:input ref="date/@special">
      <xf:label>See submission instructions</xf:label>
    </xf:input>
    <xf:input ref="date" incremental="true" appearance="minimal"
class="datefield">
      <xf:label>Date</xf:label>
    </xf:input>
    <xf:output value="date" />
  </body>
</html>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: bind input to xsd:date to get datepicker but forbid text input?

Ken Yap-2
In reply to this post by Ken Yap-2
> I think you've highlighted a second issue, which has gone unnoticed (at
> least I didn't notice it).  Have you tested and found that users can
> type in non-date text into the input field and press submit and it
> submits?  If so, that's simply a bug and should get filed in bugzilla.

Yes, in other tests, I have found that submission will fail if the
field does not validate.

> Now, onto the appearance.  It seems reasonable to ask that one of the
> apperanaces of input bound to date offer just a typein field, and that
> another offer just a date picker, and that another offer both.  If
> there's no current appearance for minimal and compact other than typein,
> perhaps we can propose this:
>
> 1. xf:input/@appearance="minimal"
> Typein field only. (Must validate, of course.)
>
> 2. xf:input/@appearnce="compact"
> Date picker only.
>
> 3. xf:input/@appearance="full"
> Typein field and date picker, perhaps with some clicks to get from one
> to another, but perhaps not.
>
> It may be that we can work together to write the XBL to do this and
> suggest it for incorporation, if it turns out 1/2/3 is what is the right
> thing to do.

First a meta-question. Are XForms implementations allowed to define
their own appearance behaviour (and would this lead to problems for
designers), or are you proposing that Mozilla XForms establish a
standard by being the first?

The current behaviour is that minimal and compact display the same, a
type-in box with a dropdown arrow for bringing up the datepicker. Full
displays only a datepicker with no way to turn it off. I sort of think
it should be like this, since I interpret appearance to be a hint of
screen space available.

minimal: type-in field only
compact: type-in field with toggle to datepicker (currently it's a
drop down)
full: datepicker only (same as current; maybe add a way to hide/show)

The problem is what I'm looking for doesn't fall into these
categories. What I'm looking for is a text field that cannot be typed
into, for displaying the selected date, plus a toggled datepicker. I
think what I'm looking for is really an xf:output as I have done in my
example, plus an xf:input with a toggled datepicker.

Are implementations allowed to use CSS to modify behaviour? Would that
be suitable for enabling the toggle in the full case?
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: bind input to xsd:date to get datepicker but forbid text input?

dr.cw.ray
On May 30, 8:08 am, Ken Yap <[hidden email]> wrote:

> > I think you've highlighted a second issue, which has gone unnoticed (at
> > least I didn't notice it).  Have you tested and found that users can
> > type in non-date text into the input field and press submit and it
> > submits?  If so, that's simply a bug and should get filed in bugzilla.
>
> Yes, in other tests, I have found that submission will fail if the
> field does not validate.
>
>
>
> > Now, onto the appearance.  It seems reasonable to ask that one of the
> > apperanaces of input bound to date offer just a typein field, and that
> > another offer just a date picker, and that another offer both.  If
> > there's no current appearance for minimal and compact other than typein,
> > perhaps we can propose this:
>
> > 1. xf:input/@appearance="minimal"
> > Typein field only. (Must validate, of course.)
>
> > 2. xf:input/@appearnce="compact"
> > Date picker only.
>
> > 3. xf:input/@appearance="full"
> > Typein field and date picker, perhaps with some clicks to get from one
> > to another, but perhaps not.
>
> > It may be that we can work together to write the XBL to do this and
> > suggest it for incorporation, if it turns out 1/2/3 is what is the right
> > thing to do.
>
> First a meta-question. Are XForms implementations allowed to define
> their own appearance behaviour (and would this lead to problems for
> designers), or are you proposing that Mozilla XForms establish a
> standard by being the first?
>
> The current behaviour is that minimal and compact display the same, a
> type-in box with a dropdown arrow for bringing up the datepicker. Full
> displays only a datepicker with no way to turn it off. I sort of think
> it should be like this, since I interpret appearance to be a hint of
> screen space available.
>
> minimal: type-in field only
> compact: type-in field with toggle to datepicker (currently it's a
> drop down)
> full: datepicker only (same as current; maybe add a way to hide/show)
>
> The problem is what I'm looking for doesn't fall into these
> categories. What I'm looking for is a text field that cannot be typed
> into, for displaying the selected date, plus a toggled datepicker. I
> think what I'm looking for is really an xf:output as I have done in my
> example, plus an xf:input with a toggled datepicker.
>
> Are implementations allowed to use CSS to modify behaviour? Would that
> be suitable for enabling the toggle in the full case?

I just happened to be perusing an article by Kurt Cagle and came
across this:

"...in some cases, you may want to be able to have a date displayed in
a different format. In that particular case you can hide the input
field (by setting its .xf-value’s CSS display property to
“display:none”) and use an output field with a calculation to change
the date configuration (second line)."

I haven't tried it out yet, but you may want to give it a shot.

There is an image of the example which is at:
http://www.oreillynet.com/xml/blog/2006/07/understanding_xforms_customiza.html
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: bind input to xsd:date to get datepicker but forbid text input?

Ken Yap-2
On Jun 2, 1:56 pm, [hidden email] wrote:

> On May 30, 8:08 am, Ken Yap <[hidden email]> wrote:
>
>
>
> > > I think you've highlighted a second issue, which has gone unnoticed (at
> > > least I didn't notice it).  Have you tested and found that users can
> > > type in non-date text into the input field and press submit and it
> > > submits?  If so, that's simply a bug and should get filed in bugzilla.
>
> > Yes, in other tests, I have found that submission will fail if the
> > field does not validate.
>
> > > Now, onto the appearance.  It seems reasonable to ask that one of the
> > > apperanaces of input bound to date offer just a typein field, and that
> > > another offer just a date picker, and that another offer both.  If
> > > there's no current appearance for minimal and compact other than typein,
> > > perhaps we can propose this:
>
> > > 1. xf:input/@appearance="minimal"
> > > Typein field only. (Must validate, of course.)
>
> > > 2. xf:input/@appearnce="compact"
> > > Date picker only.
>
> > > 3. xf:input/@appearance="full"
> > > Typein field and date picker, perhaps with some clicks to get from one
> > > to another, but perhaps not.
>
> > > It may be that we can work together to write the XBL to do this and
> > > suggest it for incorporation, if it turns out 1/2/3 is what is the right
> > > thing to do.
>
> > First a meta-question. Are XForms implementations allowed to define
> > their own appearance behaviour (and would this lead to problems for
> > designers), or are you proposing that Mozilla XForms establish a
> > standard by being the first?
>
> > The current behaviour is that minimal and compact display the same, a
> > type-in box with a dropdown arrow for bringing up the datepicker. Full
> > displays only a datepicker with no way to turn it off. I sort of think
> > it should be like this, since I interpret appearance to be a hint of
> > screen space available.
>
> > minimal: type-in field only
> > compact: type-in field with toggle to datepicker (currently it's a
> > drop down)
> > full: datepicker only (same as current; maybe add a way to hide/show)
>
> > The problem is what I'm looking for doesn't fall into these
> > categories. What I'm looking for is a text field that cannot be typed
> > into, for displaying the selected date, plus a toggled datepicker. I
> > think what I'm looking for is really an xf:output as I have done in my
> > example, plus an xf:input with a toggled datepicker.
>
> > Are implementations allowed to use CSS to modify behaviour? Would that
> > be suitable for enabling the toggle in the full case?
>
> I just happened to be perusing an article by Kurt Cagle and came
> across this:
>
> "...in some cases, you may want to be able to have a date displayed in
> a different format. In that particular case you can hide the input
> field (by setting its .xf-value’s CSS display property to
> “display:none”) and use an output field with a calculation to change
> the date configuration (second line)."
>
> I haven't tried it out yet, but you may want to give it a shot.
>
> There is an image of the example which is at:http://www.oreillynet.com/xml/blog/2006/07/understanding_xforms_custo...

Yes, it turns out we happened upon the same idea at the same time, see
my other thread. I found this other article on the web:

http://en.wikibooks.org/wiki/XForms/Formatting_a_date

It turns out to be better than width:0pt because it forbids type-in
also.
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: bind input to xsd:date to get datepicker but forbid text input?

dr.cw.ray
On Jun 2, 1:00 pm, Ken Yap <[hidden email]> wrote:

> On Jun 2, 1:56 pm, [hidden email] wrote:
>
>
>
> > On May 30, 8:08 am, Ken Yap <[hidden email]> wrote:
>
> > > > I think you've highlighted a second issue, which has gone unnoticed (at
> > > > least I didn't notice it).  Have you tested and found that users can
> > > > type in non-date text into the input field and press submit and it
> > > > submits?  If so, that's simply a bug and should get filed in bugzilla.
>
> > > Yes, in other tests, I have found that submission will fail if the
> > > field does not validate.
>
> > > > Now, onto the appearance.  It seems reasonable to ask that one of the
> > > > apperanaces of input bound to date offer just a typein field, and that
> > > > another offer just a date picker, and that another offer both.  If
> > > > there's no current appearance for minimal and compact other than typein,
> > > > perhaps we can propose this:
>
> > > > 1. xf:input/@appearance="minimal"
> > > > Typein field only. (Must validate, of course.)
>
> > > > 2. xf:input/@appearnce="compact"
> > > > Date picker only.
>
> > > > 3. xf:input/@appearance="full"
> > > > Typein field and date picker, perhaps with some clicks to get from one
> > > > to another, but perhaps not.
>
> > > > It may be that we can work together to write the XBL to do this and
> > > > suggest it for incorporation, if it turns out 1/2/3 is what is the right
> > > > thing to do.
>
> > > First a meta-question. Are XForms implementations allowed to define
> > > their own appearance behaviour (and would this lead to problems for
> > > designers), or are you proposing that Mozilla XForms establish a
> > > standard by being the first?
>
> > > The current behaviour is that minimal and compact display the same, a
> > > type-in box with a dropdown arrow for bringing up the datepicker. Full
> > > displays only a datepicker with no way to turn it off. I sort of think
> > > it should be like this, since I interpret appearance to be a hint of
> > > screen space available.
>
> > > minimal: type-in field only
> > > compact: type-in field with toggle to datepicker (currently it's a
> > > drop down)
> > > full: datepicker only (same as current; maybe add a way to hide/show)
>
> > > The problem is what I'm looking for doesn't fall into these
> > > categories. What I'm looking for is a text field that cannot be typed
> > > into, for displaying the selected date, plus a toggled datepicker. I
> > > think what I'm looking for is really an xf:output as I have done in my
> > > example, plus an xf:input with a toggled datepicker.
>
> > > Are implementations allowed to use CSS to modify behaviour? Would that
> > > be suitable for enabling the toggle in the full case?
>
> > I just happened to be perusing an article by Kurt Cagle and came
> > across this:
>
> > "...in some cases, you may want to be able to have a date displayed in
> > a different format. In that particular case you can hide the input
> > field (by setting its .xf-value’s CSS display property to
> > “display:none”) and use an output field with a calculation to change
> > the date configuration (second line)."
>
> > I haven't tried it out yet, but you may want to give it a shot.
>
> > There is an image of the example which is at:http://www.oreillynet.com/xml/blog/2006/07/understanding_xforms_custo...
>
> Yes, it turns out we happened upon the same idea at the same time, see
> my other thread. I found this other article on the web:
>
> http://en.wikibooks.org/wiki/XForms/Formatting_a_date
>
> It turns out to be better than width:0pt because it forbids type-in
> also.

any idea how they got that cute little calendar icon in the wikibook
example?
My default renders only the pull down arrow.
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: bind input to xsd:date to get datepicker but forbid text input?

Ken Yap-2
> any idea how they got that cute little calendar icon in the wikibook
> example?
> My default renders only the pull down arrow.

Maybe it's a different implementation of XForms? I'd be interested if
there is a way to replace the Mozilla XForms arrow with a custom
image; I already have a datepicker icon handy...
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: bind input to xsd:date to get datepicker but forbid text input?

dr.cw.ray
On Jun 2, 2:49 pm, Ken Yap <[hidden email]> wrote:
> > any idea how they got that cute little calendar icon in the wikibook
> > example?
> > My default renders only the pull down arrow.
>
> Maybe it's a different implementation of XForms? I'd be interested if
> there is a way to replace the Mozilla XForms arrow with a custom
> image; I already have a datepicker icon handy...

I suppose you could put an image in the label, but that wouldn't hide
the arrow.
You could do an xbl, but I don't believe it's worth the trouble.

BTW anyone following this thread, it is VERY important to use
incremental="true"    in your input field or the output won't update
until some other action that refreshes the state of the form.
Otherwise, there would be no indication to the user that there update
was successful ( I lost a good 30 minutes trying to figure out why my
updated form wasn't working by overlooking this).
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms