2 things: enter doesn't work in IE & empty form


Posted on 16th Feb 2014 07:03 pm by admin

i have this search form that works well except for 2 things.

1) on IE when i hit enter instead of the Submit button, i do not get any result. with firefox, no problem.
2) when i hit submit or enter without putting anything on the search form, it outputs All data from the database.

any help to fix the issue?

Line number On/Off | Expand/Contract <script type="text/javascript" language="JavaScript">function countryempty(){ if ( document.form.country.value == '' ) { alert('No search was entered!') return false; }}</script> <?$country = $_POST["country"]; // if page is not submitted to itself echo the formif (!isset($_POST['submit'])) { ?> <form method="POST" action="<? echo $PHP_SELF; ?>" onSubmit="return countryempty();"> <p><b>SEARCH</b> a City or Country <input type="text" name="country" size="32"><p> <p>
<input type="submit" value="submit" name="submit"><input type="reset" value="Reset" name="B2"></p> </form> <? } else {?> <? $db_host = ''; $db_user = ''; $db_pass = ''; $db_name = '';$db_table = ''; $conn = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db($db_name,$conn); // The database query follows

219 Like 20 Dislike
Previous php-forum Next php-forum
Other php-forum

my two tables
table1 : col1 = topicid , col2 = topic

table2 : col1 = sentid, col2 = sentence

Cod

Website Direction...
I recently used this code to try and make it so the page loads as http://www.domain.com/ when you ty

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

If statement help please.
Hello on my site I have 2 content boxes. 1 is for the main content (which is the biggest one) and th

textfield unchanged
hi,
i want my form to know whether its textbox is unchange or not.

if($textbox == 'unchang

Email Form Syantax Issue 2
How to make this look FROM:"OUR TEAM" instead of FROM:abc@mail.com

$headers = "

Undefined offset
The following script checks to see if the user answer matches the correct answer.

Form Fiel

having a small php error tha deals with the 'foreach'
Last night i was working on a script for a cart and it seemed to working good, until this morning. F

Thread in PHP
Thread in PHP
Some basic use and basic code for thread in php
This is my question?

update sql when refresh - php
hi
I have made a table (attachement)

the users can update the sql database using + or x bu

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash