You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ananya Goswami <an...@aztec.soft.net> on 2005/10/06 08:25:26 UTC

onBlur or onChange not working with browse button through tapestry !!!!

Hi All !!
		I have a typical problem using javascript in tapestry.
		I have a browse button in my page and a text field near it.
		According to functionality , it is required to display the
name of the file browsed in the text field immediately after browsing a
file.
		I am using the following piece of code... but am unable to
get the desired effect..
The Script part:

	<script language="Javascript">
		function populateName(filename,id)
		{
			startindex = filename.lastIndexOf("\\")+1;
			lastindex = filename.lastIndexOf(".");
			var name =filename.substring(startindex,lastindex);
			if(id==1)
			document.uploadForm.name1.value=name;
			if(id==2)
			
		}
	</script>


In the form part:


		<tr>
	       <td><input type="file" jwcid="upload1" name="upload1"
onBlur="Javascript:populateName(upload1.value,1)"/></td>
	       <td><input type="text" jwcid="name1" /></td>
		 </tr>



Please help !!!!

Thanks & Regards
-----------------------------
Ananya Goswami
Software Developer

-----------------------------
mail: ananyag@aztec.soft.net
mob: 09886886320
ph: 080-57561000
extn:3720