Search the web
Sign In
New User? Sign Up
yws-maps · Yahoo! Maps Developer Community
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Overlay a Textbox   Message List  
Reply | Forward Message #6918 of 7224 |
I'm trying to overlay a textbox over my map for easy search. However,
when I click on the box, it gains focus for a fraction of a second and
then switch back to the map. How can I keep the focus on the textbox?
Here's my code:

function createMap(){
var mapSize = new YSize(738,500);
var map = new
YMap(document.getElementById('map'),YAHOO_MAP_REG,mapSize);

var zoomPos = new YCoordPoint(5,30);
map.addZoomShort(zoomPos);

var searchPos = new YCoordPoint(5,5);
var ob = YUtility.createNode('div','search');
ob.innerHTML = '<p><input id="searchBox" type="text"
name="search" value="Search a friend"
onkeypress="checkEnter(map,event);" onfocus="this.value = \'\';"
onblur="this.value = \'Search a friend\';"/></p>';
style = {position:'absolute',
overflow:'visible',
zIndex:2,
border:'solid purple 1px'};
YUtility.setStyle(ob,style);
mo = new YCustomOverlay(searchPos,ob);

YEvent.Capture(mo,EventsList.MouseClick,function(){document.getElementById('sear\
chBox').focus();})
map.addOverlay(mo);

map.drawZoomAndCenter("United States", 15);
return map;

}




Sat Oct 4, 2008 12:12 am

torhino2000
Offline Offline
Send Email Send Email

Forward
Message #6918 of 7224 |
Expand Messages Author Sort by Date

I'm trying to overlay a textbox over my map for easy search. However, when I click on the box, it gains focus for a fraction of a second and then switch back...
torhino2000
Offline Send Email
Oct 6, 2008
5:02 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help