?
?
LiveJournal
Find more
Communities
RSS Reader
Shop
Help
Search
Log in
javascript
Log in
Join free
Join
English
(en)
English (en)
Русский (ru)
Українська (uk)
Français (fr)
Português (pt)
español (es)
Deutsch (de)
Italiano (it)
Беларуская (be)
javascript
—
< no suspend reason >
Readability
Find posts by author
Type username to filter posts in this community
Apply
More
javascript
Archive
Filter by author
Readability
Log in
No account?
Create an account
Remember me
Forgot password
Log in
Log in
Login with Sber ID
QR code
Javascript's Journal
[Most Recent Entries]
[Calendar View]
[Friends View]
Monday, January 16th, 2006
Time
Event
7:57a
Redirection
Could someone please clue me in to why this may not be working?
<form onsubmit="validateSearchForm(this.searchTerm);" style="margin: 0; "name="form1" method="post" action=""> <input style="margin-bottom: 3px;" name="searchTerm" type="text" size="23"> <input name="Search" type="submit" class="button" value="Search"> </form> <script language="JavaScript" type="text/javascript"> function validateSearchForm(field) { if(field.value.length == 0) { alert('Please enter a search term.'); return; } else { this.location.href='searchresults.php?search_term=' + field.value; } } </script>
The test works but when the field lengh is greater than 0 the redirect does not work.
Thanks very much.
(
3 Comments
|
Comment on this
)
<< Previous Day
2006/01/16
[
Calendar
]
Next Day >>
About LiveJournal.com