JavaScript – different action to same input type but different name

I have a problem with my js script because for both button will open te same site 1. I don’t know why?

Could somebody help me to reslove this problem?

HTML:

<form id="trackAndTraceForm" target="_blank" class="form-horizontal" enctype="application/x-www-form-urlencoded" method="get" action="http://apollo.loxx.pl:8080/ApolloWebBooking/WebBooking/StatusyPrzesylki.aspx">
                                <span>Track and Trace:</span>
              <input type="text" value="" name="numer" placeholder="Numer listu przewozowego"/>                                
              <input type="submit" name="spr" class="btn btn-sm btn-primary" value="Sprawdz"/>
              <input type="submit" name="pod" class="btn btn-sm btn-primary" value="POD"/>

JavaScript:

$('#trackAndTraceForm').submit(function (event)
{
    var val = $('input[name="numer"]', this).val();
    elementClicked = $(event.target);
    var typeBtn = elementClicked.attr('name');

    if(typeBtn == 'spr')
    {


            if(val.substring(0,1) != '0'){
                //console.log('nie zero');
                var action = 'http://92.43.115.24:8080/ApolloWebBooking/WebBooking/StatusyPrzesylki.aspx';
                $(this).attr('action', action);
            }   
            else{
                var action = 'http://apollo.loxx.pl:8080/ApolloWebBooking/WebBooking/StatusyPrzesylki.aspx';
                $(this).attr('action', action);
            }   
    }
    else if(typeBtn =='pod'){
        var action = 'http://www.loxx.pl/loxx_it/loxxwarpod.php';
                $(this).attr('action', action);
    }
    else {
        //do nothing;
    }


});

If I click POD button action is the same like for Sprawdz with url

http://apollo.loxx.pl:8080/ApolloWebBooking/WebBooking/StatusyPrzesylki.aspx?numer=0317037128&pod=POD


Source: stackoverflow-javascript