Chris,

You may not enjoy hearing this!

After hours and hours of changing and testing the code, I have simply
changed the function name from getValue() to getData() and the code
below works in both the latest IE and Firefox.

Presumably getValue() is used by prototype?

Cheers,

Geoff

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<title>WM</title>

<script src="assets/javascripts/prototype-1.6.0.3.js" type="text/
javascript">
</script>

<style>
.visibleDiv {
display : block
}
.hiddenDiv {
display : none
}
</style>

<script type="text/javascript">

var results = [];
var divCount = 0;

function sendResults() {

var params = ({
section1: results[0],
section2: results[1],
section3: results[2]
});

    new Ajax.Updater(
        'updateDiv',
        'wm-send.php',
        {
            asynchronous:true,
            method:'post',
            parameters: params
        }
    );

}

function getData(form) {


var radioName = form.elements[0].name;
var typeValue = form[radioName];

if(typeValue) {
        for(var i=0, n=typeValue.length; n>i; i++) {
                if(typeValue[i].checked) {
                results[divCount] = typeValue[i].value;
                //alert(results[divCount]);
                                                         }
                        }
}

if (divCount < 2) {
document.getElementById("div" + (divCount+1)).className ='hiddenDiv';
document.getElementById("div" + (divCount+2)).className ='visibleDiv';
divCount++;
} else {
document.getElementById("div" + (divCount+1)).className ='hiddenDiv';
sendResults();
}

}

</script>
</head>

<body>

<div id="div1" class="visibleDiv">
form1
<form name="myform1" action="#">
<input type="radio" name="picNum1" value="1">
<input type="radio" name="picNum1" value="2">
<input type="radio" name="picNum1" value="3">
<input type="button" name="button" value="Send"
onClick="getData(this.form);">
</form>
</div>

<div id="div2" class="hiddenDiv">
form2
<form name="myform2" action="#">
<input type="radio" name="picNum2" value="1">
<input type="radio" name="picNum2" value="2">
<input type="radio" name="picNum2" value="3">
<input type="button" name="button" value="Send"
onClick="getData(this.form);">
</form>
</div>

<div id="div3" class="hiddenDiv">
form3
<form name="myform3" action="#">
<input type="radio" name="picNum3" value="1">
<input type="radio" name="picNum3" value="2">
<input type="radio" name="picNum3" value="3">
<input type="button" name="button" value="Send"
onClick="getData(this.form);">
</form>
</div>


<div id="updateDiv"></div>

</body>
</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to