Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

PHP

Get label & input in Joomla 2.5 form

<?php echo $this->form->getLabel('name'); ?>
<?php echo $this->form->getInput('name'); ?>
https://snipt.net/embed/02810fa0a96e153428bb95c6310dfb71/
https://snipt.net/raw/02810fa0a96e153428bb95c6310dfb71/
02810fa0a96e153428bb95c6310dfb71
php
PHP
2
2016-12-03T01:28:15
True
False
False
Dec 04, 2013 at 06:07 AM
/api/public/snipt/98450/
get-label-input-in-joomla-25-form
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">form</span><span class="o">-&gt;</span><span class="na">getLabel</span><span class="p">(</span><span class="s1">&#39;name&#39;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x"></span> </span><span id="L-2"><a name="L-2"></a><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">form</span><span class="o">-&gt;</span><span class="na">getInput</span><span class="p">(</span><span class="s1">&#39;name&#39;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
form, input, joomla, label

HTML

inline form input label

<input type="text" value="Search" onfocus="if(this.value==this.defaultValue)this.value=''" onblur="if(this.value=='')this.value=this.defaultValue">
https://snipt.net/embed/e7260f334d6778bc7cbac8a926b38431/
https://snipt.net/raw/e7260f334d6778bc7cbac8a926b38431/
e7260f334d6778bc7cbac8a926b38431
html
HTML
1
2016-12-05T14:55:41
True
False
False
/api/public/snipt/24933/
inline-form-input-label
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="p">&lt;</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;text&quot;</span> <span class="na">value</span><span class="o">=</span><span class="s">&quot;Search&quot;</span> <span class="na">onfocus</span><span class="o">=</span><span class="s">&quot;if(this.value==this.defaultValue)this.value=&#39;&#39;&quot;</span> <span class="na">onblur</span><span class="o">=</span><span class="s">&quot;if(this.value==&#39;&#39;)this.value=this.defaultValue&quot;</span><span class="p">&gt;</span> </span></pre></div> </td></tr></table>
form, label

C#

Setting a color in c#

1
2
3
// Setting color of label
Label.ForeColor = System.Drawing.ColorTranslator.FromHtml("#ff6230");
Label.ForeColor = System.Drawing.Color.FromArgb( 255, 98, 48 );
https://snipt.net/embed/0ea648f1c7d16dd09931b1057c787fe3/
https://snipt.net/raw/0ea648f1c7d16dd09931b1057c787fe3/
0ea648f1c7d16dd09931b1057c787fe3
csharp
C#
3
2016-11-28T18:12:26
True
False
False
/api/public/snipt/16974/
setting-a-color-in-c
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">// Setting color of label</span> </span><span id="L-2"><a name="L-2"></a><span class="n">Label</span><span class="p">.</span><span class="n">ForeColor</span> <span class="p">=</span> <span class="n">System</span><span class="p">.</span><span class="n">Drawing</span><span class="p">.</span><span class="n">ColorTranslator</span><span class="p">.</span><span class="n">FromHtml</span><span class="p">(</span><span class="s">&quot;#ff6230&quot;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="n">Label</span><span class="p">.</span><span class="n">ForeColor</span> <span class="p">=</span> <span class="n">System</span><span class="p">.</span><span class="n">Drawing</span><span class="p">.</span><span class="n">Color</span><span class="p">.</span><span class="n">FromArgb</span><span class="p">(</span> <span class="m">255</span><span class="p">,</span> <span class="m">98</span><span class="p">,</span> <span class="m">48</span> <span class="p">);</span> </span></pre></div> </td></tr></table>
asp.net, c#, color, forecolor, label
Copyrighted, illegal, or inappropriate content? Email [email protected].