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

CommentFileSizeAuthor
exclusive-nd-search.jpg49.03 KBmattys

Comments

mattys’s picture

sorry, 2nd para above should say '...how to add (a) value to (the) Arrival date textfield...'

fietserwin’s picture

When 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 ...

fietserwin’s picture

Assigned: Unassigned » fietserwin
Category: support » feature

I'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.

mattys’s picture

great, thanks, look forward to seeing if can be done

fietserwin’s picture

Title: Add value to 'Arrival date' textfield » Allow invalid "default values" for exposed fields in availability search
Version: 7.x-3.x-dev » 7.x-4.x-dev
Status: Active » Fixed

I 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...

fietserwin’s picture

Assigned: fietserwin » Unassigned
mattys’s picture

will test, thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.