You cannot add a click event only on a portion of a background image in your input field.
However you could use the click event on the input text field and calculate based on the position of the mouse when the click happen, if the click is indeed on the good portion of the background image but that is quite complicate and the position of the mouse compared to the input text will vary in different browser.
PS: What I would do is design the input field with an image next. For instance look at this input field for the search: http://www.gamefront.com/
[EDIT] Here a sample, tested just with Mozilla. As I said before you need to play with the pixel (distanceFromTop,distanceFromLeft,inputWidth,inputHeight,pictureWitdh) to find the good spot: http://pastebin.com/00rWTadz
<script type="text/javascript">
var tempX = 0;
var tempY = 0;
document.onmousemove = getMouseXY;
function getMouseXY(e) {
tempX = e.pageX;
tempY = e.pageY;
// catch possible negative values in NS4
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
// show the position values in the form named Show
// in the text fields named MouseX and MouseY
document.getElementById('MouseX').value = tempX;
document.getElementById('MouseY').value = tempY;
return true;
}
function search(){
// position of input field
var distanceFromTop = 60;
var distanceFromLeft = 8;
// size of input field
var inputWidth = 204;
var inputHeight = 20;
// size of picture
var pictureWitdh = 20;
// dont need to check mouse position on axis y
// because onclick event already is on input field
// check mouse position on axis x
if(tempX > (distanceFromLeft+inputWidth-pictureWitdh)){
alert('Did click on the right');
}
}
</script>
<input type="text" id="MouseX" value="0" size="4"> X<br>
<input type="text" id="MouseY" value="0" size="4"> Y<br>
<input type="text" id="search" onclick="search(this)" />