Problem: So you have finished your search and the respective search
results are returned from your query to your ajax complaint <div>

Question: How does one eloquently dismiss the iPhone keyboard which
keeps hanging around given the code below ( the functioning site is at
http://www.passport-i.com):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html lang="ja" xmlns="http://www.w3.org/1999/xhtml";>
<head>

                <title>Passport-i</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0;
maximum-scale=1.0; user-scalable=0;" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<style type="text/css" media="screen">@import "iphone.css";
</style>

<script type="application/x-javascript">
addEventListener("load", function() { setTimeout(hideURLbar, 0); },
false);
function hideURLbar() { window.scrollTo(0, 1); }
</script>

<script type="text/javascript">

var xmlhttp; // need this global to deal with bug issue

function loadXMLDoc(url,responseHandler,async) {
xmlhttp = null;
if (window.XMLHttpRequest) { // code for Firefox, Opera, IE7
xmlhttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) { // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
if (xmlhttp != null) {
xmlhttp.open("GET",url,async);
xmlhttp.onreadystatechange = responseHandler;
xmlhttp.send(null);
}
else {
alert("Your browser does not support XMLHTTP.");
}
}

function updateSearch() {
var submitButton = document.getElementById("submitButton");
if ( submitButton != null ) {
submitButton.focus();
}
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
document.getElementById('results').innerHTML = xmlhttp.responseText;
xmlhttp.close;
}
else {
alert("Problem retrieving data:" + xmlhttp.statusText);
}
}
}

function doSearch() {
var search = encodeURIComponent
(document.searchform.Search_Term.value);
var url = "http://cgi.mercury-soft.com/cgi/mercury-soft.com/user-cgi-
bin/passport/iphonepassport.cgi?";
url = url + "Formaction=Searchforword&Search_Term="+search
+"&B=Yes&x=1&y=1";
loadXMLDoc(url,updateSearch,true);
return false;
}

function submitenter(event)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 10)
   {
   doSearch();
   return false;
   blur();
    }
else
   return true;
}

 function unselectform() {
                  var input = document.getElementById('Search_Term');
                  input.removeAttribute("selected");
                  input.blur();
            }
            searchform.onsubmit=function(event){
              input.setAttribute("selected", "progress");
              event.preventDefault();
              submitForm(searchform);
              setTimeout(unselectform, 4000);
            }


</script>

</head>

<body class="tim_steals_code">
<div class="toolbar"><h1>Passport-i</h1>




</div>
<div>





<div id="searchBar">
    <div class="searchBarContent">

<form name="searchform" onsubmit="event.preventDefault();doSearch
();">
<input type="text" name="Search_Term" onkeypress= "return submitenter
(event)">
<img name="button" id="submitButton" type="submit" img src =
"spotlight.png" width="35" height="32"align = "middle" value="Find"
onClick="doSearch()">
</form>

                </div>
                        </div>




</div>


<div id="results">
 </body>
</html>

Thanks for any enlightened suggestions!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to