0

I have some code which acts as a redirect and sets some values when a user clicks on a radio button. In chrome and firefox these scripts work perfectly however in IE nothing seems to happen at all.

HTML

<td>
    <input type='radio' id="order_type6" name='order_type' value="5"
        onClick="selectOrderType('1')">
    <label for="order_type6"><strong>Facility Employee</strong></label>
</td>
<td>
    <input type='radio' id="order_type7" name='order_type' value="5" 
        onClick="selectOrderType('1')">
    <label for="order_type7"><strong>Private Contract</strong></label>
</td>

JS function:

function selectOrderType(type)
{
    console.log(type);
   //replace '&load=1' with '&neworder=1'
    $location = window.location.href.replace(/&load\=1/,'&neworder=1#');
   //replace '#' at the end of the string with '' + $ordertype
    window.location.href = $location.replace(/#?$|&order_type\=\D?/,'&order_type='+type);
}
mplungjan
  • 155,085
  • 27
  • 166
  • 222
Bill.Caffery
  • 455
  • 1
  • 5
  • 20

1 Answers1

2

Remove the console.log - or press F12 to open the console.

IE does not support console if it is not open

'console' is undefined error for Internet Explorer

Or change to window.console && console.log(type)

Community
  • 1
  • 1
mplungjan
  • 155,085
  • 27
  • 166
  • 222