I have built a Multi-Step form using forms example module as a base:


I have a function that takes the user-inputted location on the first form and returns data for presentation on the 2nd form. If no data if returned back from the first form I want to hide the Next button. How can I do this?


You could try something like this on the second form:

if (empty($form_state['values']['location']) {
    $form['next']['#access'] = FALSE

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.