Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8777115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:12:51+00:00 2026-06-13T19:12:51+00:00

is it possible to add a simple html link in the label/title of a

  • 0

is it possible to add a simple html link in the label/title of a checkbox? I tried the following code:

<?php
$form['legal']['#type'] = 'checkbox';
$form['legal']['#required'] = TRUE;
$form['legal']['#title'] = t(
  'You must accept our @tos and @legals',
  array(
    '@tos'    => l(t('terms of service'), 'node/6'),
    '@legals' => l(t('legals'), 'node/7')
  )
);
?>

But that produces the follwing label (the html markup isn’t “translated”):

“You must accept our < a href=”/node/6″>terms of service< /a> and < a href=”/node/7″>legals< /a> *”

(I’ve added spaces after the opening brackets so that it will not be converted to the link i want to have)

Is it not possible to do such things? I Am new to drupal. Perhaps somebody can help me… Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:12:52+00:00Added an answer on June 13, 2026 at 7:12 pm

    This happens before you force the text to be printed as plain text.

    <?php
    $form['legal']['#type'] = 'checkbox';
    $form['legal']['#required'] = TRUE;
    $form['legal']['#title'] = t(
      'You must accept our !tos and !legals',
      array(
        '!tos'    => l(t('terms of service'), 'node/6'),
        '!legals' => l(t('legals'), 'node/7')
      )
    );
    ?>
    

    Note that you are using t() function, which acts differently on replacement’s prefix.
    If you put @tos, it will be run through check_plain() so HTML will never be processed by the browser as it encodes HTML entities.

    !tos allows HTML markup as it will not be check_plain()‘d.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to add the OR operator to php isset submit form code
Is it possible to add a form to an email newsletter? I have tried
Simple question. Is it possible to add a block of HTML in a SimpleXMLElement
Is it possible to add to PHP objects on the fly? Say I have
In a Struts 1.x application, I have a form with a simple single-selection html:select
Possible Duplicate: Simple PHP Mailer Script i run a small website and we have
Is it possible to trigger a PHP function by just clicking a link? Or
Instead of using an input type=file html tag, is it possible to bring up
I'm trying to add share buttons to my simple website... Is it possible to
Is there a simple HTML way to accomplish the following? I have a table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.