Oh, heh. Set type=text and test it with my original code again. That works here fine for me.
Too bad it's not a cross platform browser. I'm curious as to how they disable it from using the fancy Mac look so I would've like to have tested it here. Anyway, you don't need it as type=search really when you have a submit button and want the Enter key to submit the form.
Originally Posted by
shidoshi
If I can find no other solution, could I possibly use Javascript to output one style of coding to Safari, and another to everything else?
Yeah, I'll leave you with that method also.
Code:
<scrip.t>
function init() {
var agent = navigator.userAgent.toLowerCase();
var isSafari = (agent.indexOf('safari') != -1);
if ( isSafari ) {
var IdSearch = document.getElementById('searchbox');
IdSearch.outerHTML = "<input class='sbox' id='searchbox' onclick=\"if(this.value=='Search iTunes Music Store')this.value='';\" type=\"text\" value='Search iTunes Music Store' name='term' results=5 size=20>"
}
}
</scrip.t>
</head>
<body onload="init()">
That'd let you change the whole input tag to whatever new HTML you wanted if Safari's detected. You'd add that code and also add 'id="searchbox"' to the INPUT tag. The other simpler, less fancier way would be like this:
Code:
<scrip.t>
var agent = navigator.userAgent.toLowerCase();
var isSafari = (agent.indexOf('safari') != -1);
document.write('<input class="sbox" onclick="if(this.value==\'Search iTunes Music Store\')this.value=\'\';"', isSafari ? 'type="text"' : 'type="search"', 'value="Search iTunes" name="term" results="5" size="20">')
</scrip.t>
Right where you have the INPUT tag, you'd replace it with this script block inbetween your HTML. So, you get the idea. Still, I really don't think you should have to go that far for this, but there you go.
Bookmarks