DrupalBin
Submit Code
About
Recent Posts
function for clearing a cookie
1 min 58 sec
ago
Drupal 5 menu
1 hour 28 min
ago
Views 2 get all field names
2 hours 10 min
ago
Code
2 hours 48 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for Edit a hidden value with jQuery and have it show up in $form_values (D5)
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
<?php /** * This won't work when you first submit it... the hider will still show 3. * Change #value to #default_value on the hidden field for it to work. */ function test_form() { $form['hider'] = array('#type' => 'hidden', '#value' => 3); $form['submit'] = array('#type' => 'submit', '#value' => 'Submit'); return $form; } function test_form_submit($form_id, $form_values) { drupal_set_message('<pre>'. print_r($form_values, TRUE) .'</pre>'); } print drupal_get_form('test_form'); ?> <script> $('#edit-hider').val(5); </script>
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.