Hi all,

I dont know if it is possible or not, i tried to search but didnt founf anything about this.
I a using webform, i have a field which is a required select field (only one option) with the following text :By clicking on I accept the Terms of Use and the Privacy Policy.
I would like to make this option a link to the terms of use page. the tipical thing.
I tried to make it the simplest way: By clicking on I accept the <a href="node/27">Terms of Use and the Privacy Policy</a>
but didnt work.
Any idea???

Thanks

Comments

dorien’s picture

Try this:

 By clicking on I accept the <a href="<?php print base_path();?>node/27">Terms of Use and the Privacy Policy</a>

You input type should be php.

machi27’s picture

Hi
First of all thanks for answering.
I tried this but didnt work, i am getting the same message as i did with my prev code.
Between all the options that i had i though this would be the best one because of not adding more modules or modifiing any script but didnt make it work.
Anyway i was wondering if by setting imput type to php, Will i get any security hole?
Thanks again.

pragna’s picture

You should used http://api.drupal.org/api/function/l/6 for link
echo "By clicking on I accept the ". l("Terms of Use and the Privacy Policy", "node/27");

Pragna J Bhalsod

machi27’s picture

HI thanks for answering.
I don t know what i am doing wrong, i have read your link and i didnt really understand if i have to modify common.inc or where do i have to put the line echo "By clicking on I accept the ". l("Terms of Use and the Privacy Policy", "node/27");
I also was wondering if i could use the t() with this ocde, i am working with multilingual webform.

Thanks

dorien’s picture

Where exactly are you inputting the code? Not in a label right?

machi27’s picture

Nope no as a label, as it is a checkbox field i am putiing as the only option

lipcpro’s picture

machi27’s picture

This is the only solution that i havent tried yet.
I read the module but it seems that it is only for registration forms, i need it not only there, also needed in any other webform.
Do you know if this also works in any other webform? and if can be used on multilengual webforms??
thanks again

mcfilms’s picture

You said "It didn't work" and "You got the same message as previously." Can you describe the message? What didn't work? I think one of those first 2 suggestions SHOULD work. Is your content type set to PHP or Full HTML?

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

machi27’s picture

i tried bolth, first and secon d solution and it didnt work.
on the webform i have the imput type as full html and nothing. i dont have the option to set as php format, and i am putting this text as the only option of a select field with Multiple on.
i dont get any kind of message, text is not displaying properly..

+ with option 1 i get this text "node/27">Terms-of-Use-and-the-Privacy-Policy-wrapper"> node/27">Terms-of-Use-and-the-Privacy-Policy">node/27">Terms of Use and the Privacy Policy]" id="edit-submitted-i-accept-By-clicking-on-I-accept-the-node/27">Terms-of-Use-and-the-Privacy-Policy" value="By clicking on I accept the Terms of Use and the Privacy Policy" class="form-checkbox" /> By clicking on I accept the Terms of Use and the Privacy Policy

+ with option 2 i get this text :echo "By clicking on I accept the ". l("Terms of Use and the Privacy Policy", "node/27"); i tried with <php ? .... ?> so i got the same mesage at first time.

Any idea???
Thanks a lot

keva’s picture

By "i dont have the option to set as php format" do you mean it isn't listed under input format?
If not, then in /admin/build/modules, enable the PHP Filter.

machi27’s picture

I did what you said and now i have that option, but none of the previous solutions is working.
i am putting this code as an option on a select field.
with this code <?php echo 'By clicking on I accept the '. l('Terms of Use and the Privacy Policy', "node/27");?>, the field dont show up
Any idea?

mcfilms’s picture

Maybe you discovered a limitation of Webform. Maybe the developers didn't consider this use.

The way I visualize it is a simple "I Accept" checkbox with the disclaimer and link in the help section below. But I understand this is not what you want.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

machi27’s picture

I am gonna try your idea, it is not the way that i was trying to make this but at the end if it works i am happy with it. but in case it doesnt work should I open an issue about this??
thanks

machi27’s picture

I tried to put echo 'By clicking on I accept the '. l('Terms of Use and the Privacy Policy', "node/27"); in the help field but didnt work, it is not reading it as php, php format was marked as an option.
thanks all for your help and suggestions

kazar’s picture

how about in the help field you try:

By clicking on I accept the '<a href="http://yoursite.com/node/27">Terms of Use and the Privacy Policy</a>'

it seems a straight-ahead html a tag would work for your purposes, no? is there a reason this must be coded as php?

if the html option will work for you, you might want to add target="_blank" so that they can read the terms in a separate window or tab without being taken off the form they are filling in.

machi27’s picture

yep, it is working, it is not the i though that i should make this but it is working fine, I guess that i will leave it like this until i found the proper solution.

machi27’s picture

I almost made it with the final suggestion which is to place the link as the description (help), It is working half way, because it is a multilengual form, it is working it seems that i can not translate the description field with out any hack.
So I dont really know if it is possible to place a link as an option of a select field or not.
To make this work i place the not linked text as the option and the link as the description and rearrenge them by css, i have only check on FF so i guess that it will make me crazy on ie.
I really need to make this by using only the option field. any idea???

machi27’s picture

I decided to use the last option which is to put the links in the description (help) field, to make it translatable i modified "weform/components/select.inc" "line 145".

original line: '#description' => _webform_filter_descriptions($component['extra']['description']),

modified line: '#description' => t(_webform_filter_descriptions($component['extra']['description'])),

Hope it helps for someone, this is not the way that i wanted to do this but at the end is working, any sugestion about making this on the proper way will be very very apreciated.

Thanks all for your help!!!!