Forums

escape characters in forms as text

tokenring 04 Apr, 2009
I searched the forums for escape characters but I only found 2 that didn't really help me. I want to know how to enter a HTML break {br} (with the proper brackets) so it shows up as text. When it put it in the form now, it puts a break in my form.

inside a cf_text element

Aaron
GreyHead 04 Apr, 2009
Hi Aaron,

You may not be able to do this without turning the HTML editor off but try <br />

Bob
tokenring 07 Apr, 2009
I'll give this a try tonight. Thanks for all the quick help Bob! By the way, has anyone told you that you look like Greg Norman???

:-)
tokenring 23 May, 2009
I'm having a hard time figuring out how to escape a plugin command in a form. for instance;

{youtube}youtube ID{/youtube}

If I put that in the form (text, label) it runs and I can't display it as an example for the user. Right now I just replace the { with a ( and that breaks the code. Do I escape this code the same way mentioned earlier in this thread?


Aaron
GreyHead 23 May, 2009
Hi Aaron,

You need to 'Enable Mambots' in the General Tab of the Form - it should work OK then.

I've just been doing something similar with a Google Maps plugin inside a form and it works OK.

Bob
tokenring 23 May, 2009
Thanks Bob, works fine! If I enable Mambots on a form and it causes it to crash (error is just IE saying it can't open the url) are there any likely reasons?
GreyHead 23 May, 2009
Hi Aaron,

Hard to say - could be that the Mambot can't execute properly in that context. Could be almost anything else though with IE.

Bob
tokenring 24 May, 2009
Hey guys!

when I have the line "Format: {youtube}0wN57B32OPc{/youtube}" in my form along with Mambots enabled I get the following error in IE.

[attachment=0]Operataion Aborted.JPG[/attachment]

In chrome and firefox, the video is displayed in the form as the code (plugin) is executed. Is there something special about this line that I have to do to have it properly escaped. This is happening on old forms and new ones restored and created in 3.1RC5.1


Aaron
Max_admin 24 May, 2009
Hi Aaron,

does it work from normal articles pages ?

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 24 May, 2009
Hi Aaron,

You don't need to use a mambot to embed YouTube code into a ChronoForms - just add the html from YouTube into the Form HTML.

Bob
tokenring 29 May, 2009
okay... that's what I've done and that is working. The code (youtube) isn't executed and it shows up in the form correctly. However, if I dod enable mambots, the form is broken. If I enable mambots with that line of code removed from the form, the form works fine.

I was just wondering how that line of code plus enabling mambots on that form is causing it to break??

Aaron
GreyHead 30 May, 2009
Hi Aaron,

I no longer have any idea which mambots are enabled where or what code you are using where . . . Please spell it out for us.

Bob
tokenring 30 May, 2009
I can't find where the mambots are?

3.1RC5.1
<div class="form_item">
  <div class="form_element cf_heading">
    <h1 class="cf_text">Add a Video</h1>
  </div>
  <div class="clear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_text"> <span class="cf_text">Only videos related to music please... And they have to be FUNKY!!</span> </div>
  <div class="clear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label">You:</label>
    <input class="cf_inputbox required" maxlength="150" size="30" id="text_3" name="created_by_alias" type="text" />
  <a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" src="components/com_chronocontact/css/images/tooltip.png"/></a>
				<div class="tooltipdiv">Author: :: who is submitting it</div>
  </div>
  <div class="clear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label">Youtube Link</label>
    <input class="cf_inputbox required" maxlength="150" size="30" id="text_2" name="urls" type="text">
<a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" src="components/com_chronocontact/css/images/tooltip.png"/></a>
				<div class="tooltipdiv">{}youtubeID{/} :: proper youtube format.  Youtube ID's have 11 characters.  i.e.  0wN57B32OPc</div>
  </div>
  <div class="clear"> </div>
</div>
<div  class="form_item">
 <div class="form_element cf_text">
  <span class="cf_text">Format: {youtube}0wN57B32OPc{/youtube}</span>
 </div>
 <div class="clear"> </div>
</div>
<br>
<br>
<br>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label">Name of Video:</label>
    <input class="cf_inputbox required" maxlength="150" size="30" id="text_6" name="title" type="text" />
  <a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" src="components/com_chronocontact/css/images/tooltip.png"/></a>
				<div class="tooltipdiv">Name of Video: :: Name of Video:</div>
  </div>
  <div class="clear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textarea">
    <label class="cf_label">Description:</label>
    <textarea class="cf_inputbox required" rows="8" id="text_6" cols="55" name="fulltext"></textarea>
    <a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" src="components/com_chronocontact/css/images/tooltip.png"/></a>
				<div class="tooltipdiv">Description: :: Just a small description about the video</div>
  </div>
  <div class="clear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_button">
    <input value="Submit" type="submit" /><input type="reset" value="Reset"/>
  </div>
  <div class="clear"> </div>
</div>



<p><span style="color: #ffffff;"><strong>Thanks for the Video!  We will review it shortly and if approved it will be published!</strong></span></p>
<p><strong>Cheers</strong></p>
<p><span style="text-decoration: underline;"><strong>FunkyHouseBeats.com team!</strong></span></p>
<?php
$_POST['catid'] = '37';
$_POST['id'] = '';
$_POST['sectionid'] = '8';
$_POST['state'] = '0';
$_POST['created'] = date("Y-m-d H:i:s");
?>
GreyHead 30 May, 2009
Hi Aaaron,

I'm still not clear what you are trying to do with this?

"I can't find where the mambots are?" . . . but what mambots? I'm getting more confused.

Bob
tokenring 30 May, 2009
that form that I displayed has this line in it:

<span class="cf_text">Format: {youtube}0wN57B32OPc{/youtube}</span>

when I enable mambots on that form, the form crashes. If I keep mambots enabled on that form and remove that line of code, it the form is fine.

so, that line of code and mambots being enabled on this form is causing it to break.

You asked me what mambots I have enabled... I don't know where in the admin control panel where I could find this answer for you... is it in the chronoforms section?

Aaron
GreyHead 30 May, 2009
Hi Aaron,

Which YouTube plugin are you using - there seem to be lots of them?

Bob
tokenring 31 May, 2009
Content - YouTube content 1.1 Desember 2007 Stian Totland

:)
GreyHead 01 Jun, 2009
Hi Aaron,

I installed the 'Stain Totland' plugin and enabled it.

Then created a simple for with a text field where I pasted the plugin link:
<div class="form_item">
  <div class="form_element cf_text"> <span class="cf_text">{youtube}0wN57B32OPc{/youtube}</span> </div>
  <div class="cfclear"> </div>
</div>

I enabled Mambots/Plugins in the form General Tab then saved and published the form.
The video is shown OK in FireFox and in IE.

Bob
tokenring 02 Jun, 2009
I don't want the video to display. It's not being displayed in the form as expected for me... that is, if I have the mambots disabled. The code there is for example.

I'm doing the form over anyways.

:-)
GreyHead 02 Jun, 2009
Hi Aaron,

I knew I was confused . . . .

If you want the code to display with Mambots enabled whtn use html entities for the curly brackets.
<div class="form_item">
  <div class="form_element cf_text"> <span class="cf_text">{youtube}0wN57B32OPc{/youtube}</span> </div>
  <div class="cfclear"> </div>
</div>

Bob
tokenring 02 Jun, 2009
:)

I initially asked how to escape characters in a form so that they were just taken literally (not executed if the characters were code) and was displayed in the form *as is*.

When I put that youtube string in the form {youtube}blablabla{/youtube} it was being executed... so when the user went to the form, the video played. I wanted to be displayed as a tool tip... so the user knew how to enter the string.

I was recommended to ENABLE mambots instead of escaping the {}{/} characters as the outcome was the same.

I have now enabled mambots on all of my forms as it looks like it solves my issue, and probably a few more. However, 1 out of my 5 forms crashes when I enable mambots on it... it is the one that has that youtube line in it. When I disable mambots or remove that line from the form it runs okay.

I don't want the video to be displayed in the form AND I'm asking why does that combo of the two, cause the form to break?

:-)

p.s. now its just informational because my form works with mambots disabled. I'm almost done the new one too which should work.
GreyHead 03 Jun, 2009
Hi Aaron,

I've no idea - the crash is probably some other mambot that causes a problem. As you can see from my image they both work OK here.

Unless you really need mambots in your form it's not a good idea to turn them on - it will add extra processing to check them and can have unexpected results.

Bob
This topic is locked and no more replies can be posted.