Hello everyone!
My name is Roberto and I came around cause my boss did buy online support for scriptCase v7 and we got a license for v6
If this is not the best place to post these sort of questions, please admins donā blame on a noob and move it accordingly.
Anyways, here we go:
I made a āselect allā kind of javascript button inside a form just to select all the options inside a multiple select input referred as āv_patenteā in SC
Basically, the code goes just like this:
var selectBox = document.getElementById('id_sc_field_v_patente');
var aux_count;
for (aux_count = 0; aux_count < selectBox.options.length; aux_count++)
{
document.getElementById('id_sc_field_v_patente').options[aux_count].selected = true;
}
return true;
I know that code is jerky somehowā¦ but I just wanted to be sure that javascript is not throwing errors at allā¦
my aux_count variable is working
but if i try something just like this :
alert(document.getElementById('id_sc_field_v_patente').options[aux_count].innerHTML);
I got nothingā¦
If I try to pull that off directly from the console it just worksā¦ however SC doesnāt want it to happenā¦ and thatās why Iām here
I could also notice that in HTML after my new javascript button is called by onclick event, SC adds a āreturn false;ā statementā¦
it looks like this:
<span id="sc_seleccionar_todo_bot" class="scButton_default" onmouseup="if(this.disabled){ return false; }else{ this.style.cursor='pointer'; this.className = 'scButton_onmouseover'; }" onmousedown="if(this.disabled){ return false; }else{ this.style.cursor='pointer'; this.className = 'scButton_onmousedown'; }" onmouseout="if(this.disabled){ return false; }else{ this.style.cursor=''; this.className = main_style; }" onmouseover="if(this.disabled){ return false; }else{ main_style = this.cl?cursor='pointer'; this.className = 'scButton_onmouseover'; }" style="vertical-align: middle; display:inline-block;" title="Haga clic en este bot?n para seleccionar todas las patentes" onclick="[B]sc_btn_seleccionar_todo(); return false;[/B]">
Any help would be really appreciated.
Saludos!
EDIT: Additional info:
Select element is previously fullfiled by an SQL query
Then I thought that sc_getfield() method could be helpful because Iām working on a control.
But now I got a message error saying itās not defined. This already happens even if I use other methods such as
sc_alert(āholaā)
I got the same errorā¦ Do I have to load something else previously ? attach this thing to some other event such as on app init or something like that?
ayudaaaaaaaaaa csm!!!