tag:help.lighthouseapp.com,2008-09-20:/discussions/questions/1911-reset-form-input-after-submission-with-jqueryLighthouse: Discussion 2013-03-04T23:50:59Ztag:help.lighthouseapp.com,2008-09-20:Comment/255807512013-03-04T23:30:29Z2013-03-04T23:30:31Zreset form input after submission with jQuery<div><p>hi guys,... can anyone help please,... I'm using jQuery,...<br>
how can I reset form after submission with unique ID, this is what
I have so far,... but it reset ONLY for last comment report. this
form is for photo comment report,... and if I have lets say 9
comments, it only reset the last one "9" but not 1, or 2,... or
8</p>
<pre>
<code><?php echo $this->Form->create('PhotoComment', array('id'=>"ReportComments_".$photo_comment['PhotoComment']['id'])); ?>
<?php echo $form->hidden('Report.sender_id', array('value' => $user_object['id'])) ?>
<p style="font-size: 1.2em; font-weight: normal;">
<?php echo $this->Form->textarea('Report.content'); ?>
</p>
<div class="clr"></div>
<p>
<?php echo $ajax->submit('Report', array('url'=> array('controller'=>'photo_comments', 'action'=>'report_spam/'. $photo_comment['PhotoComment']['id']), 'update' => "updateReportPhotoComment_".$photo_comment['PhotoComment']['id'], 'complete' => 'javascript:resetReportPhotoCommentForm();')); ?>
<?php echo $form->end(); ?>
</p>
<div class="clr"></div>
<script>
function resetReportPhotoCommentForm()
{
document.getElementById("ReportComments_<?php echo $photo_comment['PhotoComment']['id'] ?>").reset();
}
</script></code>
</pre>
<p>thanks in advance<br>
chris</p></div>chris69mtag:help.lighthouseapp.com,2008-09-20:Comment/255807512013-03-04T23:50:58Z2013-03-04T23:50:58Zreset form input after submission with jQuery<div><p>Chris -</p>
<p>You need to submit this to cakephp.lighthouseapp.com. This is
the support forum for Lighthouse proper.</p>
<p>Thanks,<br>
Nicole</p></div>Nicole