Magento: Customer Comment on order page required field

Posted by Shamim Ahmed on Stack Overflow See other posts from Stack Overflow or by Shamim Ahmed
Published on 2012-04-10T10:26:54Z Indexed on 2012/04/10 11:29 UTC
Read the original article Hit count: 252

I am using whiteOrderComment module for customer comment on order review page. but in this section text-area field required option not working.

I did little bit change on /checkout->onepage->review->button.phtml like this

<script type="text/javascript">
function validate(){
if(document.getElementById("whiteOrderComment").value == ""){
alert('Required');
}else{
review.save();
}


</script>

<button type="submit" title="<?php echo $this->__('Place Order') ?>" class="button btn-checkout" onclick="validate();"><span><span><?php echo $this->__('Place Order') ?></span></span></button>

but in this page javascript not working.

can you please give any better idea, how can i make this text-area field required.

thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about validation