How do I keep this function from firing?

I have a form that includes a multi select pulldown. The pulldown boasts a feature where you can input some data at the top in order to filter the list below.

Very cool!

It looks like this:

The problem, however, is that when you first input the data and hit "return," some validation scripting that's attached to the form kicks in and you wind up with this:

another screenshot
How can I restrict the validation code from firing to that time when the user clicks on "submit," as opposed to hitting "return?" Both "functionalities" work, I just need to ensure that they fire separately based on a "return" versus a "click."

How would I pull that off?

Here's what my form looks like:

<form action="#" method="get" target="_self">
	<b>start date:</b>&nbsp;<select id="date" class="super" name="sdate"><option value=""></option><option value="...">...</option>
	<option value='2015-09-06'>2015-09-06</option><option value='2015-09-05'>2015-09-05</option><option value='2015-09-04'>2015-09-04</option><option value='2015-09-03'>2015-09-03</option></select>&nbsp;&nbsp;&nbsp;
	<b>end date:</b>&nbsp;<select id="edate" class="super" name="edate"><option value=""></option><option value="...">...</option>
	<option value='2015-09-06'>2015-09-06</option><option value='2015-09-05'>2015-09-05</option><option value='2015-09-04'>2015-09-04</option><option value='2015-09-03'>2015-09-03</option><option value='2015-09-02'>2015-09-02</option><option value='2015-09-01'>2015-09-01</option><option value='2015-08-31'>2015-08-31</option><option value='2015-08-30'>2015-08-30</option><option value='2015-08-29'>2015-08-29</option><option value='2015-08-28'>2015-08-28</option><option value='2015-08-27'>2015-08-27</option><option value='2015-08-26'>2015-08-26</option><option value='2015-08-25'>2015-08-25</option><option value='2015-08-24'>2015-08-24</option><option value='2015-08-23'>2015-08-23</option><option value='2015-08-22'>2015-08-22</option><option value='2015-08-21'>2015-08-21</option></select>&nbsp;&nbsp;&nbsp;<b>region(s):</b>&nbsp;
		<div style="position:absolute; width:203px; height:35px; margin-top:-25px; margin-left:371px;">
		<select id="region" name="region"><option value="CAROLINAS/TENNESSEE">Carolinas / Tennessee</option><option value="CENTRAL TEXAS">Central Texas</option><option value="FLORIDA">Florida</option><option value="GEORGIA/ALABAMA">Georgia / Alabama</option><option value="GREAT PLAINS">Great Plains</option><option value="HOUSTON/GULF COAST">Houston / Gulf Coast</option><option value="ILLINOIS/WISCONSIN">Illinois / Wisconsin</option><option value="KANSAS/MISSOURI">Kansas / Missouri</option><option value="MICHIGAN/INDIANA/KY">Michigan / Indiana / Kentucky</option>
		<option value="MOUNTAIN">Mountain</option><option value="NEW ENGLAND">New England</option><option value="NORTHERN CALIFORNIA/NEVADA">Northern California / Nevada</option><option value="NY METRO/NNJ">New York / Northern New Jersey</option><option value="PA/WV/OHIO">PA/WV/Ohio</option><option value="PACIFIC NORTHWEST">Pacific Northwest</option><option value="PHILADELPHIA">Philadelphia</option><option value="SOUTH CENTRAL">South Central</option><option value="SOUTHERN CALIFORNIA">Southern California</option><option value="SOUTHWEST">Southwest</option><option value="UPSTATE NY">Upstate NY</option><option value="WASH/BALT/V">WASH/BALT/VA</option></select>
	<img src="images/spacer.gif" style="width:185px; height:10px;">
	&nbsp;&nbsp;&nbsp;<b>rank</b>&nbsp;<input type="radio" name="toc" id="toc_r" value="rank" >&nbsp;&nbsp;<b>trend</b>&nbsp;<input type="radio" name="toc" id="toc_t" value="trend" >&nbsp;&nbsp;&nbsp; 
		<div style="position:absolute; width:100px; height:30px; margin-left:685px; margin-top:-28px;">
		<input type="image" src="images/submit_button.png"  alt="Submit" onclick="return IsEmpty()"> 

Open in new window

Bruce GustPHP DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontyWeb Ninja at largeCommented:
capture the enter key when it's pressed and return false:

first, attach the function to your <BODY> tag:

<body onkeypressdown="return checkForEnterKey( event );">

then create a JS function to do nothing when it is pressed:

function checkForEnterKey( e ) {
    var code = (e.keyCode ? e.keyCode : e.which);
    if( code == 13 ) { //Enter keycode
           return false;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.