here's some examples
<script>
function declareFlds1(obj) {
document.frm.txt2.value = obj.value;
}
function declareFlds2(obj) {
document.frm.txt2.value = obj;
}
</script>
<form name="frm">
onBlur event
<input type="text" name="txt1" onBlur="declareFlds1(this)">
<input type="text" name="txt2">
or button
<input type="button" value="see it" onClick="declareFlds2(document.frm.txt1.value)">
</form> ---------------------------------------
{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee"

;alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924