How to get the bID in validation auto.js in Block
Permalink
Anybody please tell me, how to get the Block Id (bID) in the validation function in auto.js
ccmValidateBlockForm
Thanks,
Bala
ccmValidateBlockForm
Thanks,
Bala
great.. thx Moosh
@moosh's solution is good.
Another way to do it (which isn't better or worse, just a different style) is to declare a javascript variable in the add.php and edit.php files -- it will be available for the auto.js file to use. For example:
Another way to do it (which isn't better or worse, just a different style) is to declare a javascript variable in the add.php and edit.php files -- it will be available for the auto.js file to use. For example:
<script type="text/javascript"> var bID = <?php echo $bID; ?>; </script>
yes correct Jordan, I was trying to put it in hidden fields.
Add this in your block controller :
Then in auto.js, you can use :
++