2
How can I take the X value of an INPUT and generate an IMG URL using Javascript?
Example:
- I put the number 505050 in the form and gave Submit;
Form Code:
<form action="teste" method="GET">
<input name="qtdfor" type="text" class="inputtext" size="10" maxlength="10">
<input type="Submit" name="botaoEnviar" value="Enviar">
</form>
As I do for Value 505050 be concatenated with . jpg already inside the IMG tag so?
IMG TAG:
<img src="https://localhost/sig/_downloadFoto?parametro2=Alunos/**505050**.jpg" alt="Foto perfil" height="42" width="42">
The only thing that will change is the image id?
– Danilo Pádua
That: <img src="https://localhost/Sig/_downloadFoto? parametro2=Students/XXXXXX*. jpg" alt="Profile photo" height="42" width="42">
– Erick Amoedo
You will always take the input value and add it to XXXX
– Erick Amoedo
Also: if you need it to be in pure Javascript, please add this information as well... there are already 2 answers with jQuery
– brasofilo
Some of the answers served you @Erickamoedo?
– Danilo Pádua
Hello @Danilo! It worked yes, thank you very much!!
– Erick Amoedo