# ERROR Object expected

**URL:** https://forum.kirupa.com/t/error-object-expected/319071
**Category:** web dev
**Created:** [February 8, 2011, 10:27am UTC](https://forum.kirupa.com/t/error-object-expected/319071 "2011-02-08T10:27:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cjj](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@cjj](https://forum.kirupa.com/u/cjj)
#### Post date: [February 8, 2011, 10:27am UTC](https://forum.kirupa.com/t/error-object-expected/319071/1 "2011-02-08T10:27:52Z")

</div>

Hi, I am NOT very fluent in JavaScript, so I apologize upfront if this appears silly.

I took over the design/development of a website and it had a page created using asp, which I had to convert to php. But now the JavaScript doesn’t seem to work.

The error I keep getting in IE is:

Message: Object expected  
Line: 96  
Char: 1  
Code: 0

The html code that calls the function is as follows:

```auto
<input type="radio" name="donationAmount" id="donationAmount" value="10.00">
<input type="radio" name="donationAmount" id="donationAmount" value="20.00">
<input type="radio" name="donationAmount" id="donationAmount" value="30.00">
<input type="radio" name="donationAmount" id="donationAmount" value="40.00">
<input type="submit" value="Paypal" onclick="submitform('paypal');">
<input type="submit" value="Paygate" onclick="submitform('paygate');">

```

And the JavaScript function is like this:[FONT=monospace]

[/FONT]

```auto
<script>
function submitform(whichform)
{
 
document.forms['paypalform'].amount.value = getRadioValue();
document.forms['paygateform'].AMOUNT.value = parseFloat(getRadioValue().replace('.','')* 7.4);
 
if (whichform == 'paypal')
    {
       
        document.forms['paypalform'].submit();
    }
else {
 
   
    document.forms['paygateform'].submit();
    }
 
}
 
 
function getRadioValue() {
            for (index=0; index < document.amounts.donationAmount.length; i++) {
                if (document.amounts.donationAmount*.checked) {
                    var radioValue = document.amounts.donationAmount*.value;
                    break;
                }
            }
       
        return radioValue;
 
    }
 
 
</script>

```

[FONT=monospace]

[/FONT]If anyone can help me or point me in the right direction, I would be so grateful. Thank you very much!
