Hi, I really need help with text field with css image.
I have wrote code, this code is works great but I could not figure out how to write the rest of code, there is a text field that are relate to email address, for sample if person enter email of hotmail such as (username@hotmail.com) then it will change the email domain name to image using css and insert into the text field after user name so it will be look like(username + image) together in text field and the value of text filed will be (username@hotmail.com) so basically to use z-order statment for image in CSS!
currently this code's works great when select doamin name and insert into the text field after user name, but my problme is that trying to figure how to insert image instead of domain name!
please see code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
function EMailComplete(obj){
var eles=obj.form.elements;
for (var zxc0=0;zxc0<eles.length;zxc0++){
if (eles[zxc0]==obj&&zxc0>0){
if (eles[zxc0-1].type=='text'){
var index=eles[zxc0-1].value.indexOf('@')
if (index>-1){ eles[zxc0-1].value=eles[zxc0-1].value.replace(eles[zxc0-1].value.substring(index),''); }
eles[zxc0-1].value+=eles[zxc0].value;
break
}
}
}
}
//-->
</script>
<link href="gamefile.css" rel="stylesheet" type="text/css">
</head>
<body>
<form>
<input = "value" >
<select onchange="EMailComplete(this);">
<option value="id=game" >Provider</option>
<option value="@" >@another</option>
<option value="@ntlworld.com" >@ntlworld.com</option>
<option value="@hotmail" >@hotmail.com</option>
<option value="@yahoo.com" >@yahoo.com</option>
</select>
</form>
</body>
</html>
how can i write that code in javascript and CSS to allow me to select domain name and auctomatic insert the image into the text field after user name!
please help thanks.