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.
Did you know?Explore Trending and Topic pages for more stories like this.
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
No comments posted yet
Your Answer:
Login to answer
219
20
Other forums
'grab_files', multiple extension?
hey guys,
can anyone suggest a way to make to following line of code look for files with more
Encrypt php code?
Is it possible to encrypt php code in files,
so that it displays a load of unreadable characters
Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:
QuoteBlah blah
Blah blah
etc
but when i ech
generating random codes
Hi guys n gals,
I have a requirement to generate 250,000 unique codes...
These codes a
Menu restriction
How can I restrict the individual menu that would appear when a user logs in so that all users are c
Printing issues with xMII 11.5
For some reason, we have one report (and only one) that is giving us fits when trying to print. The
Can anyone give me some link on .htaccess tutorial
i wish to have friendly url using .htaccess, but no idea yet about this
Hope that anyone cou
Storing Values taken from a DB...
Using this code it will generate a short list from my database
<?php
mysql_connect
Getting a variable to work in function params
I have this fuction which is inside a class:
Code: public static function generateEmbedCode($
socket communication between c++/java and sending image
hi,
i have a class in c++ called win32_sockserver which creates socket to java. i am trying