Note that there are some explanatory texts on larger screens.

plurals
  1. POMultilevel quote in JavaScript?
    primarykey
    data
    text
    <p>OK, this is perhaps stupidest question ever but bear with me....</p> <p>How to make this work:</p> <pre><code>$("#basephoto").after( '&lt;tr&gt;&lt;td valign="bottom"&gt;Additional photo:&lt;/td&gt; &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;div id="addphoto'+curupfld+'" class="browsebg"&gt; &lt;p class="bpath"&gt;&lt;/p&gt; &lt;input onchange="fillBrowse(\"#addphoto'+curupfld+'\",this); validateExt(field);" class="browse transfield" type="file" name="altphoto'+curupfld+'" size="40" /&gt; &lt;span onclick="delImgField(this.id)" id="delbtn'+curupfld+'" class="abuttons delbtn"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt;'); </code></pre> <p>The part of interest:</p> <pre><code>onchange="fillBrowse(\"#addphoto'+curupfld+'\",this); validateExt(field);" </code></pre> <p>The problem starts at the "onchange". I can always make a function that calls these two and the solution would be:</p> <pre><code>$("#basephoto").after( '&lt;tr&gt; &lt;td valign="bottom"&gt;Additional photo:&lt;/td&gt; &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt; &lt;td&gt; &lt;div id="addphoto'+curupfld+'" class="browsebg"&gt; &lt;p class="bpath"&gt;&lt;/p&gt; &lt;input onchange=functionCaller("#addphoto'+curupfld+'",this) class="browse transfield" type="file" name="altphoto'+curupfld+'" size="40" /&gt; &lt;span onclick="delImgField(this.id)" id="delbtn'+curupfld+'" class="abuttons delbtn"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt;'); </code></pre> <p>This works, but if possible I would like to solve the problem rather than just use a workaround method.</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