I am trying to make textfields clickable so it would appear as link. What would be the best solution for this? I tried Link module, but it is not what I am looking for. This is how I got my textfield written:

$form['element4']['link4'] = array(
        '#type' => 'textfield',
        '#title' => t('link for 4th div'),
        '#description' => t('your link'),

I need for it to stay textfield as user can input his value, but I want it to be displayed lets say in blue color and so that you could click on it. How could I do this in the most simple way?

  • Do you want to make field label as clickable and field value as textfield?
    – arpitr
    Sep 26, 2016 at 12:21

1 Answer 1


What you need is the #ajax property of the Form API. Have a look at this page to find the answer to your question:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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