Jquery - sometimes working script
Consider the following script for checking if search form is empty. The id's of search buttons are: `mainSearch` and `searchIcon`

		<script type="text/javascript">
		$(document).ready(function() {
			$('#mainSearch').click(function() {
					if($("input[type=text][name=search]").val() == "" || $("input[type=text][name=search]").val() == 'Напишете търсената дума'
					|| $("input[type=text][name=search]").val() == 'Enter search keywords here')
						return false;
			});
		});
		$(document).ready(function() {
			$('#searchIcon').click(function() {
					if($("input[type=text][name=q]").val() == "" ) 
						return false;
			});
		});
		</script>
For some reason the second function is working on every page. The first function works only on the home page. Another problem is pressing enter button; nobody should submit clear form with enter. Any help is greatly appreciated.
Jquery - sometimes working script
===

Consider the following script for checking if search form is empty. The id's of search buttons are: `mainSearch` and `searchIcon`

		<script type="text/javascript">
		$(document).ready(function() {
			$('#mainSearch').click(function() {
					if($("input[type=text][name=search]").val() == "" || $("input[type=text][name=search]").val() == 'Напишете търсената дума'
					|| $("input[type=text][name=search]").val() == 'Enter search keywords here')
						return false;
			});
		});
		$(document).ready(function() {
			$('#searchIcon').click(function() {
					if($("input[type=text][name=q]").val() == "" ) 
						return false;
			});
		});
		</script>
For some reason the second function is working on every page. The first function works only on the home page. Another problem is pressing enter button; nobody should submit clear form with enter. Any help is greatly appreciated.