Closed (fixed)
Project:
Availability Calendars
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2011 at 16:06 UTC
Updated:
6 Sep 2012 at 08:51 UTC
Hello
My Arrival date textfield is set to 'From arrival during duration'.
I would like to find out how to add value to 'Arrival date' textfield, so, 'Arrival date' text will be displayed in the textfield.
The reason for this is that my design for the search block does not have labels, not required if you can add or update a value for form elements, as per above.
See attached for a visual.
Matt
| Comment | File | Size | Author |
|---|---|---|---|
| exclusive-nd-search.jpg | 49.03 KB | mattys |
Comments
Comment #1
mattys commentedsorry, 2nd para above should say '...how to add (a) value to (the) Arrival date textfield...'
Comment #2
fietserwinWhen I developed the Views filter handler for availability I did not understand why there is so few validation in the default supplied filters (numeric and date which I originally extended). With this example, I start to understand why one would not validate values entered in the Views UI for exposed filters. But still, if the user leaves this value untouched, it will lead to a validation error when (s)he presses "Search Availability". (The date filter does not give a validation error but happily converts it to 0 and builds a query with that as value...)
For another site where the client also wanted in-field labels, I used the jQuery defaultvalue plugin. It is easy to use and works like a charm (but this was not a Drupal site). Bonus is that the default values are not sent to the server on submit. Thus no validation errors, no people with "phone" as telephone number...
I think that this is not something this module should provide, but that you should build yourself using the mentioned jQuery plugin. Might be a good candidate for a contrib module ...
Comment #3
fietserwinI'll see what I can do within the limits of Views and Drupal form handling. Assigning to myself as to create a todo list for 7.x-3.3.
Comment #4
mattys commentedgreat, thanks, look forward to seeing if can be done
Comment #5
fietserwinI loosened the validation and it now works. But if you use the date popup module, a date field with an invalid default value will be emptied by that module...
Comment #6
fietserwinComment #7
mattys commentedwill test, thanks