Reputation: 341
I have the following code on my search form:
<form name="search" method="get" action="www.test.gr" enctype="multipart/form-data"
onsubmit="window.location.href='www.test.gr/search/document.getElementById('location').value';
return false;">
But it is not working. Maybe the quotes are wrong inside document.getElementById
.
Can anyone help please?
Upvotes: 0
Views: 44
Reputation: 12882
You should concat string with object value. In your case document.getElementById('location').value
statement is interpreted as a part of a string.
<form name="search" method="get" action="www.test.gr" enctype="multipart/form-data" onsubmit="window.location.href = 'www.test.gr/search/' + document.getElementById('location').value; return false;">
Upvotes: 2