This topic is locked

Get value checkbox, how?

4/27/2009 1:58:46 PM
ASPRunnerPro General questions
R
Ricardo Web author

Hi,
I have checkbox built automatically for the program asp runner, look image.



In code html the program, have code for the checkbox

<INPUT type=checkbox {$checkbox_attrs}>
url=http://www.uploadimagens.com/]

[/url]
How get value this checkbox, for use future?
help?

tanks.

J
Jane 4/28/2009

Ricardo,
please give me more detailed description of where do you want to use these values.

All selected records are available in the BeforeDelete event.

R
Ricardo Web author 4/28/2009

Visual Editor
I want use in On screen Event.
I create a button with function call()



this function call() is in include/header.asp , image
I want to get the value checkbox, and put in variable checkbox, for malipulation.
How?


J
Jane 4/29/2009

Richard,
here is a sample:

var checkbox1 = document.getElementById("check1").checked;

R
Ricardo Web author 4/29/2009

good,
But i need to know , which checkbox´s are checked, but i can't put in function Call():
var checkbox3 = document.getElementById("check3").checked;

if (checkbox3 == true)

{

alert('OK');

}
because if checkbox3 don't exist?
How know the checkbox3 exists , but i don´t put if document.getElementById("check3"), imagine if have 50 checkbox in list?
tanks.

J
Jane 4/30/2009

Here is just a sample JavaScript code:

var i;

if ((typeof frmAdmin.elements['selection[]'].length)=='undefined')

frmAdmin.elements['selection[]'].checked=this.checked;

else

for (i=0;i<frmAdmin.elements['selection[]'].length;++i)

{

alert(this.checked);

}

R
Ricardo Web author 4/30/2009

where is this.checked ? ,Because in alert this.checked shows "undefined".

J
Jane 5/4/2009

Ricardo,
it's just a sample code.

I recommend you to open this page in browser (View source mode) and check JavaScript code for select/unselect checkbox, print/export selected features.