LiamzEffectz
01-18-2010, 07:37 PM
Hi,
I'm trying to make a code where I can highlight 1 or 2 using Javascript, and when I submit the form the php will know which code is highlighted and then I can use it later on in my code.
<script type="text/javascript"><!--
function checkBoxClick($) {
$.className = 'boxSelected'; for(var i = 0, _ = $.id.split('_'); i <= 4; i++ ) {if(_[1] != i) {try {document.getElementById(_[0] + '_' + i).className = 'box';} catch(__) { break; }}}window.document.forms[0][_[0]].value = _[1];
}
//--></script>
<span class="boxSelected" onclick="checkBoxClick(this);" id="blaah_1">1</span><br />
<span class="box" onclick="checkBoxClick(this);" id="blaah_2">2</span>
I'm new here so I don't really know if my explanation is good enough.
But thanks in advance for anybodies help as I've been on this for 2 hours :eek:
I'm trying to make a code where I can highlight 1 or 2 using Javascript, and when I submit the form the php will know which code is highlighted and then I can use it later on in my code.
<script type="text/javascript"><!--
function checkBoxClick($) {
$.className = 'boxSelected'; for(var i = 0, _ = $.id.split('_'); i <= 4; i++ ) {if(_[1] != i) {try {document.getElementById(_[0] + '_' + i).className = 'box';} catch(__) { break; }}}window.document.forms[0][_[0]].value = _[1];
}
//--></script>
<span class="boxSelected" onclick="checkBoxClick(this);" id="blaah_1">1</span><br />
<span class="box" onclick="checkBoxClick(this);" id="blaah_2">2</span>
I'm new here so I don't really know if my explanation is good enough.
But thanks in advance for anybodies help as I've been on this for 2 hours :eek: