Skip to main content

All Questions

Tagged with
18 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
2 answers
4k views

How to trigger a form and pass variables to $form_state with jQuery?

What is the way to trigger a Drupal form via JavaScript, and pass new values to $form_state while doing so? I have a main form, which has an element that triggers a jQuery UI dialog with a form in it. ...
Danny_Joris's user avatar
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
2 votes
2 answers
2k views

Trigger jQuery "add more" multiple times

I have a form that I am filling with default values in hook_form_alter. Some of the fields are in a in a field group and I need to trigger the "add more" button using code. I figured out how to send ...
Venn's user avatar
  • 83
2 votes
0 answers
115 views

Creating ajax forms with ajax

I have been trying to implement popup forms that load dynamically, which initially seemed pretty easy. My current method is to echo the form from a menu callback, and insert it where needed with js. ...
MWay's user avatar
  • 273
1 vote
0 answers
678 views

jQuery clone of an select form with ajax event

I'm trying to clone with jQuery the block which contain a form with an ajax event. function module_api_change_currency_form($form, &$form_state){ $form['currencies'] = array( '#...
GwenM's user avatar
  • 684
1 vote
0 answers
83 views

How use geofield_openlayers in custom module

I'm writing a drupal custom module, in my form I need a geofield with openlayers map widget. I can create a geofield_openlayer by using Content type, but I don't know how can I create the field in my ...
Gianfranco's user avatar
1 vote
0 answers
122 views

Is it possible to build a form with jQuery and still use ajax elements and Drupal 7 Form API?

I have a form built using for the most part many ajax elements within the form api. The form is working if a user is going through it at a normal pace however as this is to be a productivity tool, any ...
Inigo Montoya's user avatar
1 vote
0 answers
812 views

AJAX submit ignored if comments form is loaded with AJAX

In D7, I have a custom module enabling AJAX form submission on comments forms. That is working great. I also have comments being loaded in the commentsblock module using block_refresh with the below ...
Joshua Stewardson's user avatar
0 votes
0 answers
46 views

Checkbox Form Element: Displaying checkboxes value based on on/off

I have a checkbox form element that uses taxonomy terms via variable_get as #default_value; storing the result. I don't want to overwrite value, I just want the form to render/display checked ...
kubak's user avatar
  • 1
0 votes
1 answer
298 views

Attach behavior only to the file upload button

I have a form with a managed_file field where I need to know when the upload button is clicked, and then perform an action. I decide to make it by attaching a behavior to my button but it also trigger ...
Gwaldhorf Miopau's user avatar
0 votes
1 answer
626 views

Using 'return' with an ajax callback renders an entire page before my content is loaded

I'm developing a module that uses Openlayers maps and Drupal Commerce. When you click on the map, you should see products that relate to those coordinates of where you click. I have this working ...
Jason Glisson's user avatar
0 votes
0 answers
109 views

Form error messages are not displaying in colorbox

I have a custom form which is displaying in a colorbox. But the problem is when I set an error in validate function using form_set_error, the red border appears against the field but the error ...
Ahmad's user avatar
  • 2,845
0 votes
1 answer
903 views

Conflict between ajax callback and jQuery UI dialog

I have a button that triggers an AJAX callback with the form api like so : $form['show_modal'] = array( '#type' => 'submit', '#value' => t('Some crazy text'), '#ajax' => array( '...
Germain's user avatar
  • 170
0 votes
1 answer
927 views

Form validate without submit action

I'm developing a site that it will use Services for the CRUD operations and ANGULARJS for the comunication frontend <-> backend. Now when I want to insert a new content of content type FOO I will ...
ZioBudda's user avatar
  • 1,182
0 votes
2 answers
636 views

Save form when user refreshes page from browser or click on any anchor tag inside page

I have made a form in drupal. What I want is when the browser unload the page from any click whether by clicking on anchor tag or from browser refresh buttons I want to save data of my form through ...
Pradeep's user avatar
  • 35
0 votes
0 answers
655 views

How to update clientside validation rules in real time

I have a form in which a user can select the type of text input field that they would like to use (based on the available text input type fields that the clientside validation model supports - let's ...
user5013's user avatar
  • 1,497
0 votes
1 answer
327 views

jQuery is not working for inserting data

I want to save data from a textbox on a button click. I am using jQuery AJAX for this task. Please note that I made this tags inside theme function. function theme_user_post_block($vars) { $...
simple user's user avatar
0 votes
1 answer
143 views

Is it necessary to "activate" a file input field after a jQuery insertion?

I've got a Bootstrap modal that I use to present a form through which I can create and edit an node on my site. This object has an uploaded file associated with it, so things work in the usual way: ...
Jim Miller's user avatar
  • 1,948