I'm getting an error of "[control].get_value is not a function". I've been trying to hunt down the proper javascript... but everything I've found suggests that the get_value should work.
The first alert works fine; the second alert fails. The Firefox Error Console gives me the error - "txtGrossCommission.get_value is not a function".
I'm obviously missing something - No idea what though. Any help would be great.
| <script type="text/javascript"> |
| function PreventPostback(sender, eventArgs) |
| { |
| var txtGrossCommission = document.getElementById('<%= radNumCommissionValue0.ClientID %>'); |
| var txtTypeValue = document.getElementById('<%= radNumCommissionValue.ClientID %>_text'); |
| var ddlType = document.getElementById('<%= radComboType.ClientID %>_ClientState'); |
| var txtCommission = document.getElementById('<%= radNumCommissionAmount.ClientID %>'); |
| var re1 = new RegExp(".+\"value\":\""); |
| var re2 = new RegExp("\",\"text\".+"); |
| var clientValue = ddlType.value.replace(re1, "").replace(re2, ""); |
| alert(sender.get_value()); |
| alert(txtGrossCommission.get_value()); |
| if(clientValue == "percent") |
| { |
| txtCommission.set_value(txtGrossCommission.get_editValue() * txtTypeValue.get_editValue()/100); |
| } |
| else if(clientValue == "flatrate") |
| { |
| txtCommission.set_value(txtTypeValue.get_editValue()); |
| } |
| } |
| </script> |
The first alert works fine; the second alert fails. The Firefox Error Console gives me the error - "txtGrossCommission.get_value is not a function".
I'm obviously missing something - No idea what though. Any help would be great.