cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
HTML links in field name blow up radio buttons
December 6, 2007
10:11 pm
galiel
Guest

Please replace the ??? with your data!

  • Your URL: http://???
  • The browser used: Firefox OS X Leopard 2..0.0.11 (but verified on others)
  • cforms version: 6.2
  • Your Wordpress version: 2.3.1

[desc]: Help says field name supports HTML, and you have examples of that, but no mention about using HTML in options. cforms apparently doesn't like "a links", at least in radio buttons. Using the following in the input field:

Please choose one of the following:#<a href="example1">Example 1</a>#<a href="example2">Example 2

creates the following mess:

<ol class="cf-ol">
<li id="li-3-2" class="cf-box-title">Please choose one of the following:</li>
<li id="li-3-2items">
<input id="cf3_field_21" type="radio" example1="" value="<a href=" name="cf3_field_2"/>
Example 1" checked="checked" class="cf-box-a"/>
<label id="label-3-21" class="cf-after" for="cf3_field_21">
<span>
<a href="example1">Example 1</a>
</span>
</label>
<br/>
<input id="cf3_field_22" type="radio" example2="" value="<a href=" name="cf3_field_2"/>
Example 2" class="cf-box-a cformradioplus"/>
<label id="label-3-22" class="cf-after" for="cf3_field_22">
<span>
<a href="example2">Example 2</a>
</span>
</label>
<a href="example2">
<br/>
</a>
</li>
<a href="example2"/>
</ol>
<a href="example2"/>
</fieldset>
<a href="example2"/>
 
and so forth, iterating on. 

Is there a system of escapes that will allow use of HTML in options, or is that (pardon the pun) not an option? 

December 6, 2007
10:16 pm
galiel
Guest

Sorry, left out the closing tag in the example I created for the comment above. a links still don't work in radio buttons, but the result is the following:

<ol class="cf-ol">

<li id="li-3-2" class="cf-box-title">Please choose one of the following:li>
<li id="li-3-2items">
<input id="cf3_field_21" type="radio" example1="" value="" name="cf3_field_2"/>
Example 1" checked="checked" class="cf-box-a"/>
<label id="label-3-21" class="cf-after" for="cf3_field_21">
<span>
<a href="example1">Example 1a>
span>
label>
<br/>
<input id="cf3_field_22" type="radio" example2="" value="" name="cf3_field_2"/>
Example 2" class="cf-box-a cformradioplus"/>
<label id="label-3-22" class="cf-after" for="cf3_field_22">
<span>
<a href="example2">Example 2a>
span>
label>
 
Oddly, the correct syntax appears as the "after" label, but an extra, broken instance of the label appears before it.

December 7, 2007
12:14 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Please provide a link to the above scenario.

December 7, 2007
5:38 am
galiel
Guest

As this is part of a redesign that will replace a live site, it is running on a local MAMP installation at the moment, so I unfortunately can't provide a live link. However, the HTML I pasted in the second message shows how the display code breaks when using the following field name for the radio buttons:

Please choose one of the following:#<a href="example1">Example 1</a>#<a href="example2">Example 2</a>

Note: I have upgraded to v6.41 since posting initially, to see if that would fix the problem, but it hasn't. I also tried adding regular text before and after the link to see if it was the proximity to the # that was causing the error, but that did not make a difference – when it gets to the a link, it misinterpretes the HTML.

 

 

December 7, 2007
7:40 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Correct, HTML -as per the documentation- is currently only accepted in the form labels part of the field name entry field, which is the part at the beginning up to where the first actual parameter of a given input field starts.

I'll see if I can include it in a another patch release v6.42 perhaps.

EDIT:

It indeed is working already, however be aware that the option "value" you provide (a link) is being put also inside the value="(your link)" parameter of the input field. And that's what is breaking it.

The correct use would be to additionally give the radio button a real value, e.g.:

my options#<a href="http://123"&gt;|realvalue123#<a href="http://456"&gt;|realvalue456#…

December 7, 2007
3:52 pm
galiel
Guest

Ah, of course, my mistake. Thank you for the prompt attention – and for a great, multifaceted plugin. I have used the forms function extensively, but his was my first time trying to use a link in radio buttons.

May 13, 2013
4:45 pm
Oskar
Guest

Oliver said

Correct, HTML -as per the documentation- is currently only accepted in the form labels part of the field name entry field, which is the part at the beginning up to where the first actual parameter of a given input field starts.

I'll see if I can include it in a another patch release v6.42 perhaps.

EDIT:

It indeed is working already, however be aware that the option "value" you provide (a link) is being put also inside the value="(your link)" parameter of the input field. And that's what is breaking it.

The correct use would be to additionally give the radio button a real value, e.g.:

my options#<a href="http://123">|realvalue123#<a href="http://456">|realvalue456#…

I have the same problem with links in the Field Name becoming weird html but I can't understand what you did to make it work :S

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
30 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3748

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5347

Posts: 18717

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)