Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

How to limit form submission per user per day and week?

The goal is very straightforward. I need a form to limit each user to 1 submission per day and 3 per week. What I found: Webform: The "Form settings" in webform has the "Per user submission limit" ...
CocoSkin's user avatar
  • 891
0 votes
0 answers
24 views

Field gets unset and fails validation in user edit form

We have a special date field that we set upon user creation when our custom user form is submitted. The user does not have to set this field themselves. We have a separate form, which is a user edit ...
Vincent Buscarello's user avatar
0 votes
1 answer
106 views

Date popup field won't display in tableselect element

I am attempting to embed a couple of date fields within a tableselect element, and after trying to use both textfield and date_popup field types, I can't get either to work. Here's my form function ...
wonder95's user avatar
  • 1,219
0 votes
1 answer
856 views

How to set Form API date_select option values

Creating a date_select field in a custom form, like this: $date_format = "Y-m-d"; $form['birth_date'] = array( '#type' => 'date_select', '#title' => t('Date of birth'), '#...
Frank H.'s user avatar
  • 804
5 votes
2 answers
1k views

Setting date_popup year range to more than the 3 years default in Drupal 7

I have a custom module and using date_popup. Currently the popup only shows a 3 year range in the date popup. $form['startdate'] = array( '#type' => 'date_popup', '#title' =&...
Patoshi パトシ's user avatar
0 votes
2 answers
93 views

Change timezone display format in user edit page

In drupal 7 timezone field in user edit will be like Asia/Kolkata: Friday, October 9, 2015 - 17:24 +0530. I want to display it like Asia/Kolkata. I have tried the method specifed in https://drupal....
user avatar
2 votes
1 answer
104 views

How to change timezone format for user/site settings?

I want to change the user configurable timezone format on the regional settings and user settings form. For example, it displays as Asia/Kolkata: Friday, October 9, 2015 - 17:24 +0530 I want to ...
user avatar
0 votes
1 answer
1k views

How can I replace the date picker with a text field that shows a date picker when it has the focus?

I installed the Date Picker module, which works fine. This is what appears when I add the datepicker element to the form. This is the code I use to add the datepicker element. $form['date'] = array( ...
2 votes
3 answers
3k views

How to set a value for a date field?

I need to set a value for a date field with type datetime in hook_form_alter. I tried with below codes. But it is not working. $form["field_event_date"]["und"][0]['#default_value']['value'] = $...
Aswini K's user avatar
  • 438
1 vote
3 answers
495 views

How to change the label of the "To:" field in the Date Module

This doesn't seem to be the kind of thing you can change using hook_form_alter() unless I'm missing something. The label of the "From" field can be any value you want, but the "to" field, if you have ...
John Horner's user avatar
1 vote
1 answer
176 views

date_popup + theme = infinite loop

I'm trying to create a templated form including date_popup field in a custom module. There is a very basic example : mkl_variousTest.module ( dependency : date_popup from date API ) <?php //...
tyd01's user avatar
  • 33
3 votes
0 answers
2k views

Multiple date picker for date popup widget

I've been searching for a while, but didn't find any contribute module to store multiple date values picking them from only one date popup calendar widget, just a 2009 feature request for D6. In D7 I ...
Cheope's user avatar
  • 137
3 votes
2 answers
2k views

Storing a date created with Form API

Very simply, I'm creating a date of birth field pragmatically like so: $form['dob'] = array( '#type' => 'date', '#required' => TRUE, '#title' => t('Date of Birth'), '#...
Scott Lawrence's user avatar
3 votes
1 answer
2k views

How to ajax changing date field on _node_form?

On content type called Order have 2 fields - "Category name" (term reference) and "Date" (Date (Unix timestamp)). On node edit form I want to change date to other value (for test purpose it is "hard ...
svetlio's user avatar
  • 1,504
1 vote
1 answer
988 views

How to display date and time inside a form #markup?

I want to retrive a UNIX epoch (as returned by the PHP function time()) and display it as a formatted date as part of a text (i.e. a #markup element) in a form. This is not a field where the user is ...
Free Radical's user avatar
  • 15.1k
1 vote
1 answer
599 views

How to make the date field of authoring information in Create Article page a date field?

In the page to create new article, at the bottom in the authored on tab, how do I make the date textbox to a date field with date picker? I mean, I want it to be easy for the publisher to choose ...
esafwan's user avatar
  • 1,348
1 vote
0 answers
1k views

How to use multi-value, full calendar date picker in node form?

Users previously reported vehicle use in an Excel sheet formatted to look like a full month calendar. Clicked cells in the "calendar" marked visual x's (via macro) on days they used a vehicle, and ...
Stay-at-home-dad's user avatar
0 votes
1 answer
112 views

Date #return_value to ordinary time()

So I have included a date field in my custom block form and would like to use the date. However it is saved as an array which I am finding a little difficult to work with: The format for "#...
WestieUK's user avatar
  • 3,838