Skip to main content
Tweeted twitter.com/#!/StackDrupal/status/281701137441230848
added 126 characters in body
Source Link
Sandesh Yadav
  • 1.3k
  • 1
  • 16
  • 39

I wanted to hook node/add/patient-history form because I wanted to add ajax in that form.

Before adding Ajax I wanted to get field names correctly. So I tried this:

function ajaxify_form_patient_history_node_form_alter(&$form, &$form_state, $form_id) {
  $form['field_history_patient_id']['und'][0]['#value'] = "Hello";
  // I also tried 
  $form['field_history_patient_id']['#value'] = "Hello";
}

They are not working.

I am not sure if I am taking the field names incorrectly or missing something else.

Hook name seems to be correct because this one works:

  $form['actions']['submit']['#value'] = t('Save History');

I found some similar questions on stackexchange but with no answers.

Any advice/links appreciated very much. Thank you.

I wanted to hook node/add/patient-history form because I wanted to add ajax in that form.

Before adding Ajax I wanted to get field names correctly. So I tried this:

function ajaxify_form_patient_history_node_form_alter(&$form, &$form_state, $form_id) {
  $form['field_history_patient_id']['und'][0]['#value'] = "Hello";
  // I also tried 
  $form['field_history_patient_id']['#value'] = "Hello";
}

They are not working.

I am not sure if I am taking the field names incorrectly or missing something else.

I found some similar questions on stackexchange but with no answers.

Any advice/links appreciated very much. Thank you.

I wanted to hook node/add/patient-history form because I wanted to add ajax in that form.

Before adding Ajax I wanted to get field names correctly. So I tried this:

function ajaxify_form_patient_history_node_form_alter(&$form, &$form_state, $form_id) {
  $form['field_history_patient_id']['und'][0]['#value'] = "Hello";
  // I also tried 
  $form['field_history_patient_id']['#value'] = "Hello";
}

They are not working.

I am not sure if I am taking the field names incorrectly or missing something else.

Hook name seems to be correct because this one works:

  $form['actions']['submit']['#value'] = t('Save History');

I found some similar questions on stackexchange but with no answers.

Any advice/links appreciated very much. Thank you.

added 8 characters in body
Source Link
Sandesh Yadav
  • 1.3k
  • 1
  • 16
  • 39

I wanted to hook node/add/patient-history form because I wanted to add ajax in that form.

Before adding Ajax I wanted to get field names correctly. So I tried this:

function ajaxify_form_patient_history_node_form_alter(&$form, &$form_state, $form_id) {
  $form['field_history_patient_id']['und'][0]['#value'] = "Hello";
  // I also tried 
  $form['field_history_patient_id']['#value'] = "Hello";
}

They are not working.

I am not sure if I am taking the field names incorrectlyfield names incorrectly or missing something elsemissing something else.

I found some similar questions on stackexchange but with no answers.

Any advice/links appreciated very much. Thank you.

I wanted to hook node/add/patient-history form because I wanted to add ajax in that form.

Before adding Ajax I wanted to get field names correctly. So I tried this:

function ajaxify_form_patient_history_node_form_alter(&$form, &$form_state, $form_id) {
  $form['field_history_patient_id']['und'][0]['#value'] = "Hello";
  // I also tried 
  $form['field_history_patient_id']['#value'] = "Hello";
}

They are not working.

I am not sure if I am taking the field names incorrectly or missing something else.

I found some similar questions on stackexchange but with no answers.

Any advice/links appreciated very much. Thank you.

I wanted to hook node/add/patient-history form because I wanted to add ajax in that form.

Before adding Ajax I wanted to get field names correctly. So I tried this:

function ajaxify_form_patient_history_node_form_alter(&$form, &$form_state, $form_id) {
  $form['field_history_patient_id']['und'][0]['#value'] = "Hello";
  // I also tried 
  $form['field_history_patient_id']['#value'] = "Hello";
}

They are not working.

I am not sure if I am taking the field names incorrectly or missing something else.

I found some similar questions on stackexchange but with no answers.

Any advice/links appreciated very much. Thank you.

improved formatting
Source Link
AjitS
  • 10.9k
  • 7
  • 41
  • 73

I wanted to hook node/add/patient-history form because I wanted to add ajax in that form.

Before adding Ajax I wanted to get field names correctly. So I tried this:

function ajaxify_form_patient_history_node_form_alter(&$form, &$form_state, $form_id) {
 
  $form['field_history_patient_id']['und'][0]['#value'] = "Hello";
 
     // I also tried 
 
     $form['field_history_patient_id']['#value'] = "Hello";
 
    }

They are not working.

I am not sure if I am taking the field names incorrectly or missing something else.

I found some similar questions on stackexchange but with no answers.

Any advice/links appreciated very much. Thank you.

I wanted to hook node/add/patient-history form because I wanted to add ajax in that form.

Before adding Ajax I wanted to get field names correctly. So I tried this:

function ajaxify_form_patient_history_node_form_alter(&$form, &$form_state, $form_id) {
 
 $form['field_history_patient_id']['und'][0]['#value'] = "Hello";
 
     // I also tried 
 
     $form['field_history_patient_id']['#value'] = "Hello";
 
    }

They are not working.

I am not sure if I am taking the field names incorrectly or missing something else.

I found some similar questions on stackexchange but with no answers.

Any advice/links appreciated very much. Thank you.

I wanted to hook node/add/patient-history form because I wanted to add ajax in that form.

Before adding Ajax I wanted to get field names correctly. So I tried this:

function ajaxify_form_patient_history_node_form_alter(&$form, &$form_state, $form_id) {
  $form['field_history_patient_id']['und'][0]['#value'] = "Hello";
  // I also tried 
  $form['field_history_patient_id']['#value'] = "Hello";
}

They are not working.

I am not sure if I am taking the field names incorrectly or missing something else.

I found some similar questions on stackexchange but with no answers.

Any advice/links appreciated very much. Thank you.

Source Link
Sandesh Yadav
  • 1.3k
  • 1
  • 16
  • 39
Loading