/    Sign up×
Community /Pin to ProfileBookmark

[drupal ] Hash character (#) automatically translated to "%23" when form is loaded

Hi, I want to add a link like this to a form

[CODE]<a id=”addButton” href=”#” style=”display: inline-block;”></a>[/CODE]

So I use this code

[code=php] $form[‘addButton’] = array(
‘#attributes’ => array(‘style’ => ‘display: inline-block;’),
‘#type’ => ‘link’,
‘#title’ => t(”),
‘#href’ => current_path() . “#”,
‘#id’ => ‘addButton’,
);
[/code]

The problem is, when I load the form, the link translated to “http://localhost:8082/admin/config/zoho/test[B]%23[/B]” instead of “http://localhost:8082/admin/config/zoho/test[I]#[/I]“. Can someone please tell me how to fix this error? ? I’m desperate. ? I cannot test my other code because of this stupid bug.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@priyankagoundOct 16.2013 — well...why dont you try out with the simple link code as below:

echo " <a href="http://www.website.com">Click here to visit site</a>";

Hope this helps.
Copy linkTweet thisAlerts:
@atn_webdev2010authorOct 22.2013 — thanks anyway but I use #markup and it works ?
×

Success!

Help @atn_webdev2010 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...