netnode IT services GmbH
Mythenstrasse 7
6003 Luzern
041 450 10 66
Kontaktformular
Newsletter [neu]
Das DrupalMediaCamp stellt das Content Management Framework Drupal und dessen Nutzen in Medienunternehmen ins Zentrum. Auf dem Camp werden zahlreiche Medienkonzerne berichten, die Drupal bereits heute erfolgreich bei sich einsetzen. Lukas Fischer von netnode wird eine Session über "Die Zukunft von Drupal" halten.
What I want is not to get the selected value of a select field which is quite easy.
<?php
$('#select_id').val();
?>I want to set a value of a select dropdown. I didn't found any useful function so I made my own.
<?php
/**
* @param string select_id The Id of the select element you want to set
* @param string value The value you what to select
*/
function _select_option(select_id, value) {
//if value exists
var value_exists = false;
$("#"+select_id+" option").each(
function(val, htmlelement) {
if ($(this).val() == value) {
value_exists = true;
}?>Whenever you have to write your own access function for a menu entry - here is the short explenation how to do this:
The menu entry should have a "access callback" definition. This defines the function which checks the access and returns true or false. You cann pass arguments via the 'access arguments' definition.
<?php
$items['whatever/%/edit'] = array(
'title' => t('Edit'),
'page callback' => 'dosomething_edit',
'page arguments' => array(1),
'access callback' => 'check_edit',
'access arguments' => array(1),
'weight' => 1,
'type' => MENU_LOCAL_TASK,
);?>