I have the following code

```
@using (Html.BeginForm("ConfirmBid", "Lot"))
{
    ...
    <input name="button" value="Place bid" type="submit" class="btn btn-size2" />
    ...
}

```

I want to run some JavaScript code when the button is pressed but only if the controller method ConfirmBid goes to a specific line of code (a success path). How might this be achieved?