4

So I'm trying to do something really simple but haven't manage to know how to do it with the Ajax API form from drupal 7. I have an administrative GUI with a select input type, I set the #ajax property with the callback but I don't want to replace anything just need to reload/refresh the values for specific inputs most of them textfield, when the selection change.

Any insight on how to do this? Can it be done with the Ajax Drupal 7 API?

Thanks....

2

You should put a wrapper around the fields of which you want to reload/refresh (basically replace) and in the call back return the either the form values in an array or the wrapper.

This basically means that on the event specified in the callback, eg change the whole wrapper div is swapped out and replaced with a new one built by the php in your form.

  • 1
    can you add more details? – user7282 May 10 '13 at 11:53
  • 1
    @user7282 - Look inside Examples module, there you get what you want. Look for the Form API Examples. There's at least one Ajax example. – leymannx Sep 27 '15 at 10:35

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.