2
Well, come on, I believe my doubt is simple but I can’t unravel.
<h2 style="color:#333333; font-family:verdana;font-size:100%;text-align:center">Código de Cliente:
<input type="text" id="codigocliente" /></h2>
<label for="lista">lista</label>
<select name="lista" id="lista" disabled="disabled">
<option>Digite seu CPF</option>
<option value="b3cdb2_353be7884bbf44488145b33338c03e52~mv2">12345678</option>
<option value="b3cdb2_0bb5060e934b4896a8d78974355254d8~mv2">00000000</option>
</select>
</label>
<h3 style="text-align:center">
<button type="button" class="button" onclick="window.open('https://static.wixstatic.com/media/' + document.getElementById('lista').value + '.jpg')" ><span>Acessar</span></button>
</h3>
I have this scrypt, I would like the select to automatically select the value by the value entered in the input. Type, if in the input the client enters the value 00000000, Selected automatically switches to this value, if it does not exist, display an alert saying that the value does not exist.
I left Selected disabled because I don’t want to display the list of values, I just want the client to type in the input and Selected to select the value if it exists or send a message saying that the value does not exist.
Once the value of Selected is selected, it has a button to which it redirects it to a specific image or file.
Search for Jquery’s each() function, this can help you.
– Victor Hugo
oninput
– DaviAragao