Hey I am trying to know what is the value of of a check box (true, or false)

but i cant seem to get it write

function getPrice(boxName){

	alert(form1.Soft_Top_Cloth.checked) // Hard code box name it works
	alert(form1.boxName.checked) // passed threw variable not working 
}
<input type="checkbox" name="<%= boxName %>" id="<%= boxName %>>" onchange="getPrice('<%= boxName %>')" />

Thanks for all the help

Moiseszaragoza,

Is that client-side VB?

If so, then boxname is well and truly out of scope - it being a server-side asp|jsp (or similar) variable - and you need to address the HTML element by the value of boxName.

I don't know VB so can't suggest more but that may point you in the right direction.

Airshow

Thanks for trying.


the problem was a typo where there are 2 > but its working fine now

thanks

Moiseszaragoza,

Cool.

I didn't spot the double >>.

And I know why I thought the code was VB but I'm not going to explain because everyone will think me real stooooopid.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.