Arianule
Arianule

Reputation: 9043

redirecting not working in firefox

I have a little function to redirect a person to page of search results based on a text value input and the redirect function that I used in Javsacript works fine in IE and Google Chrome but however does not work in fireFox.

$(document).on("click", "input[name='btnSearchTest']", function () {
//alert('test');


var txtBoxValue = $('#txtSearchGeneral').val();
if (txtBoxValue == "") {
    alert("Please enter a value");
    return false;
}
window.event.returnValue = false;

document.location = "SearchResults.aspx?search=" + txtBoxValue;

Any advice perhaps on how to get redirecting done using javascript in firefox

regards

Upvotes: 0

Views: 799

Answers (2)

Shafeeque
Shafeeque

Reputation: 2069

Use

   window.location.href = "SearchResults.aspx?search=" + txtBoxValue;

Upvotes: 3

Amit
Amit

Reputation: 15387

Try this

window.location.href = "SearchResults.aspx?search=" + txtBoxValue;

Upvotes: 3

Related Questions