Setar valor no html:file

2 respostas
Z

Galera estou tentando setar um valor no file do html mais não estou conseguindo, na verdade ela até seta no value, mais não aparece na tela…

//Não funciona 
<html:file property="urlArquivo" name="form">
 <bean:write name="form" property="urlArquivo" /></hml:file >
//também tentei.
<script>
document.getELementById('urlArquivo').value = '<bean:write name="form" property="urlArquivo" />'
</script>

Se alguem puder me ajudar agradeço…

2 Respostas

Licuri

cara tenta assim deve funcionar.

<script>
	function carregarParametro(){
		document.getElementById('browse').click();
		document.getElementById('urlArquivo').value=document.getElementById('browse').value;		  
	}
</scipt>
	<input type=file name=browse style="display: none;">
		<html:text property="urlArquivo" styleClass="frmTxt1"></html:text>
			<input 	type=button class="uma class qualquer para seu botão" style="font-weight:bold;text-transform:lowercase;text-align:center;"
						onClick="carregarParametro()"
						value="Procurar...">

Na sua action vc deverá pegar o valor do text (urlArquivo).
E vc ainda pode personalizar o seu botão.
Falow .

Z

:smiley: :smiley: :smiley: funcionou, muito legal esta solução…
valeu…

Criado 17 de julho de 2007
Ultima resposta 20 de jul. de 2007
Respostas 2
Participantes 2