Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. function custom_form_alter_form_alter(&$form, &$form_state, $form_id) {
  2. if ($form_id == 'form_id') {
  3. if(isset($_SESSION['sesstionvariable1'])){
  4. if($_SESSION['sesstionvariable1'] == 'var1'){
  5. $form['field_role']['und']['#default_value'] = '1';
  6. }
  7. elseif($_SESSION[sesstionvariable2'] == 'var2'){
  8. $form['field_role']['und']['#default_value'] = '2';
  9. }
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement