All Questions
12 questions
10
votes
4
answers
21k
views
How to make form buttons call only javascript?
I'm experimenting with JavaScript and Drupal forms. Currently I'm trying to make a button in the administration form of a module that will use JavaScript to append options to a select list. The ...
6
votes
2
answers
6k
views
How to extend or "hook" Drupal Form AJAX?
I'm working with standard admin form, which has 'add_more' button for one of fields.
My task is to move some fields to jQuery UI Dialog just for usability. When dialog was closed I manually append it'...
1
vote
1
answer
4k
views
EntityMalformedException: Missing bundle property on entity of type node in modal
I want to open create content type in modal, according to modal form and modal api example, I implement it, I test
the problem is here
when I test it by contact form
ctools_include('modal');
...
25
votes
3
answers
15k
views
Multiple Values to Trigger #states
How can I have multiple values trigger the Form API's #states?
Say for example, I wanted this field to be visible not only if the value is 5 (currently works below), but wanted to make the field ...
12
votes
2
answers
7k
views
Right way to add JS and CSS to node/edit and other forms
I am making a site with a lots of JS, and I am wondering where I should put the JS code. Optimally I would like to keep the JS with each module and not the theme layer. Some content could be exposed ...
10
votes
8
answers
25k
views
How to add a JS confirmation popup when clicking an #ajax button
I have a basic FAPI button input that is #ajax enabled and that's working fine, but I want to add a JS "Are you sure?" confirmation popup when clicking the button before the code actually runs, and I'...
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. ...
4
votes
1
answer
3k
views
How to pass Javascript variable with form on submit?
I want to pass a variable created with Javascript to $form_state so that I can use this variable in the form_submit function.
In an ajaxified form I can use:
Drupal.ajax[ajax_el].options.data....
3
votes
2
answers
716
views
What are the alternatives for storing client side encrypted data?
I want to store client side encrypted data in Drupal 7, so that it is encrypted on the client end, and stored and transmitted in encrypted form. The password is never transmitted or stored on the ...
2
votes
1
answer
820
views
Why does $form_state['input'] not correspond to the html of the form upon submittal?
I have a drupal form with repeatable fields allowing to type in as many phone numbers as one wants. Simplifying to the extreme, the code looks like this:
function form_test($form, $form_state) {
$...
2
votes
3
answers
8k
views
Fire javascript on a form submit
Even the searching I have done that looks like there may be a solution doesn't really seem to answer this.
I have a form with an input value. When the user enters a value and clicks submit, I want ...
0
votes
1
answer
1k
views
How to use Form API #attached and module's own scripts with jQuery Multi module?
I was using jQuery Update module, but it conflicts with Views and feature requests for library version per page or per theme are consistently killed. On the other side, Views maintainers seems to ...