Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat are those ways to change text in textarea when button on click in javascript?
    primarykey
    data
    text
    <p>For example right now I have:</p> <pre><code>&lt;textarea style='width:100%;height:300px' id='default_file' readonly="readonly"&gt; {$defaultFileContents[0]|escape} // smarty code &lt;/textarea&gt; </code></pre> <p>However, I want it to display something equivalent to (when click "next" button for example):</p> <pre><code>&lt;textarea style='width:100%;height:300px' id='default_file' readonly="readonly"&gt; {$defaultFileContents[1]|escape} // smarty code &lt;/textarea&gt; </code></pre> <p>and with index 2, 3, 4, and so on. </p> <p>$defaultFileContents is an array of strings retrieved from PHP scripts. </p> <p>Edited:</p> <pre><code>{literal} &lt;script language="javascript" type="text/javascript" src="modules/Yastt/views/tpls/editarea/edit_area/edit_area_full.js"&gt;&lt;/script&gt; &lt;script language="javascript" type="text/javascript"&gt; editAreaLoader.init({ id : "default_file" // textarea id ,syntax: "{/literal}{$fileType}{literal}" // syntax to be uses for highgliting ,start_highlight: true // to display with highlight mode on start-up ,allow_toggle: true ,is_editable:false }); editAreaLoader.init({ id : "translated_file" // textarea id ,syntax: "{/literal}{$fileType}{literal}" // syntax to be uses for highgliting ,start_highlight: true // to display with highlight mode on start-up ,allow_toggle: true }); {/literal} &lt;/script&gt; &lt;table&gt;&lt;tr&gt;&lt;td colspan='2'&gt; &lt;div style='font-size:18px;font-weight:bold;'&gt;File Edit ({$defaultLang} To {$translatedLang}) &lt;/div&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt; &lt;div style='font-size:18px;font-weight:bold;'&gt;{$file}&lt;/div&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;textarea style='width:100%;height:300px' id='default_file'&gt; {$defaultFileContents[0]|escape} &lt;/textarea&gt; &lt;form method='POST' name='FileEdit' action='index.php'&gt; &lt;input type='hidden' name='module' value='Yastt'&gt; &lt;input type='hidden' name='action' value='saveraw'&gt; &lt;input type='hidden' name='lang' value='{$translatedLang}'&gt; &lt;input type='hidden' name='file' value='{$file}'&gt; &lt;input type='submit' value='Save'&gt; &lt;input type='button' value='Cancel' onclick='document.location.href="index.php?module=Yastt&amp;action=overview&amp;lang={$translatedLang}"'&gt; &lt;input type='button' value='Copy From Above' onclick='document.getElementById("translated_file").value = decodeURIComponent("{$defaultFileContents[0]|escape:'url'}");'&gt; &lt;textarea style='width:100%;height:500px' name='rawfile' id='translated_file'&gt; {$translatedFileContents|escape} &lt;/textarea&gt; &lt;/form&gt; &lt;br&gt; &lt;/form&gt; </code></pre> <p>How would you modify this tpl code?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload