CodeIgniter Forums
JS problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: JS problem (/showthread.php?tid=10087)



JS problem - El Forum - 07-18-2008

[eluser]Mitja[/eluser]
Code:
<tr>
<td class="arrangementPluspayments">
<table class="arrangementPluspayment">
<tr><td>Fotka: &lt;?php if (isset($error_pluspayment)) echo $error_pluspayment;?&gt;&lt;input type="file" id="file" name="pluspayment_title_photo" /&gt;&lt;/tr>
<tr><td>Opis: <br />&lt;textarea name="pluspayment_description"&gt;&lt;/textarea></tr>
</table>
</td>
</tr>
<tr><td><a href="[removed]addArrangementPluspayment()">[+] dodaj novo</a></td></tr>

JS code

Code:
var number = 1;
function addArrangementPluspayment() {
var pluspayment = $(".arrangementPluspayment:first").clone(true);
$(pluspayment).children().children("input").val("");
$(pluspayment).children().children("input").name = 'pluspayment_title_photo' + number;
$(".arrangementPluspayments").append(pluspayment);

number++;

}



JS problem - El Forum - 07-18-2008

[eluser]Bramme[/eluser]
Yeah, you're gonna HAVE to be a little bit more descriptive before we can even consider giving you an answer...

What are we supposed to do with this???


JS problem - El Forum - 07-18-2008

[eluser]Mitja[/eluser]
Code:
$(pluspayment).children().children("input").name = 'pluspayment_title_photo' + number;

this part not working. Name is not changed. I need to change default name="pluspayment_title_photo" to name="pluspayment_title_photo1"


hope understand me


JS problem - El Forum - 07-20-2008

[eluser]thinkigniter[/eluser]
Is this jquery?

If it is your function is incorrectly formated.

Try posting in the Jquery forums.