I try desperately for hours and hours to get this 2 little script working without success . If I use them just like that, no one work but if I include only one no problem. So the issue is not with the code itself but with a conflict when code are used together. I tried dozen of combination and also by adding some else statement but without luck too.
CODE 1
<script type="text/javascript">// <![CDATA[
function on_my_form_loaded(event) {
if (event=='reserve')
var mobile_number_param = document.getElementById('mobile_number_param');
mobile_number_param.value = "[cb:userdata field="cb_myfield" user="#me" /]";
mobile_number_param.readOnly = true;
var email = document.getElementById('email');
email.readOnly = true;
var first = document.getElementById('first');
first.readOnly = true;
var last = document.getElementById('last');
last.readOnly = true;
}
// ]]></script>
CODE 2
<script type="text/javascript">// <![CDATA[
function on_my_form_loaded(event) {
if (event=='show_cart')
document.getElementById('empty_cart_block').style.display='none';
}
// ]]></script>
Unfortunately I'm not a coder...Someone have a suggestion please ?
ifstatements...ifline enclosed in another set of curly braces. Then move lines 3 and 4 of the second block between the now two closing curly braces of the first block.