OK, this is perhaps stupidest question ever but bear with me….
How to make this work:
$("#basephoto").after(
'<tr><td valign="bottom">Additional photo:</td>
<td> </td>
<td><div id="addphoto'+curupfld+'" class="browsebg">
<p class="bpath"></p>
<input onchange="fillBrowse(\"#addphoto'+curupfld+'\",this); validateExt(field);" class="browse transfield" type="file" name="altphoto'+curupfld+'" size="40" />
<span onclick="delImgField(this.id)" id="delbtn'+curupfld+'" class="abuttons delbtn"></span></div>
</td>
</tr>');
The part of interest:
onchange="fillBrowse(\"#addphoto'+curupfld+'\",this); validateExt(field);"
The problem starts at the “onchange”. I can always make a function that calls these two and the solution would be:
$("#basephoto").after(
'<tr>
<td valign="bottom">Additional photo:</td>
<td> </td>
<td>
<div id="addphoto'+curupfld+'" class="browsebg">
<p class="bpath"></p>
<input onchange=functionCaller("#addphoto'+curupfld+'",this) class="browse transfield" type="file" name="altphoto'+curupfld+'" size="40" />
<span onclick="delImgField(this.id)" id="delbtn'+curupfld+'" class="abuttons delbtn"></span>
</div>
</td>
</tr>');
This works, but if possible I would like to solve the problem rather than just use a workaround method.
I really don’t know what you are really doing. But if you just wan’t to write it in a more jQuery way.. This may help..
Check out this post to know more how to create elements using jQuery:
*P.S.: Don’t say it’s stupid. I’m just like you before.. :]