{err for="msg"}

{textarea} smarty php

in addition to the previous question, I have this code:

   <p class="required">
  {err for="msg"}
   <!--{{label {t _inquiry_msg}:}}-->
   {textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';"}

  {/err}
 </p>

      

And I want the result to be

<textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';">Write here!</textarea>

      

I tried {/textarea}

but it didn't work in my template file.

Also, using html tags <>

doesn't work, it breaks the page.

http://euroworker.no/Konftel-300-IP.268

Can this be done in smarty / php?

Thanks:)

+2


a source to share


6 answers


Direct recording:

<textarea onblur="if(this.value=='') this.value='Skriv her';" 
          onfocus="if(this.value=='Skriv her') this.value='';">Write here!</textarea>

      



If it doesn't work, it has nothing to do with smarty.

+2


a source


Just put:

<textarea onblur="if(this.value=='') this.value='Skriv her';" 
          onfocus="if(this.value=='Skriv her') this.value='';">Write here!</textarea>

      



Smarty doesn't replace anything.

+1


a source


You should really start with the W3C markup validator and try to find your error.

+1


a source


Are you missing something:

<!--{{label {t _inquiry_msg}:}}-->

      

I don't know what this code is supposed to do, but the error here is definitely

<!--{{label} {t _inquiry_msg}:}}-->

      

then the HTML should work fine

<textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';">Write here!</textarea>

      

0


a source


Try the following and keep commenting: -

  • Try to remove all the commented lines between the "{err for =" msg "}" and "{textarea}" lines.
  • Now remove the curly braces from the "textarea" line of code and write plain HTML, as "Luis Melgratti" posted in his answer.
  • If possible, try uploading some screenshots of the error image that appears on the page.
0


a source


Smarty 3 or Smarty 2? Since tag filtering has {...}

been improved in version 3 .

0


a source







All Articles