I'm looking for solution for following scenario in my D7 site. I have form with 2 empty text fields. If user enters value in field 1 and submits form next time when he opens this form only field 2 will be available for input.


you can achieve it with some code in your custom module

function yourmodule_form_alter(&$form, &$form_state, $form_id)
    if ($form_id == 'your_form_id' ) { // in your custom content type 
    if($form["nid"]["#value"]){  //when we are in edit form
      if(isset($form['field_your_field1']['und'][0]['#default_value']['value']) )
     if(isset($form['field_your_field2']['und'][0]['#default_value']['value']) )
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.