• After more than 30 years running websites and forums I am retiring.

    I have made many friends through the years. I will cherish my time getting to know you. I wish you all the best. This was not an easy decision to make. The cost to keep the communities running has gotten to the point where it's just too expensive. Security certificates, hosting cost, software renewals and everything else has increased threefold. While costs are up ad revenue is down. It's no longer viable to keep things running.

    All sites will be turned off on Thursday 30 November 2023. If you are interested in acquiring any of the websites I own you can Email Schwarz Network.

Como validar el TextBox que se encuentra dentro de un Repeater

R

Roberto Eder

Guest
Como puedo validar el TextBox con ID txtCodigoArticulo para saber si esta vacio, esta dentro de un Repeater y no me esta dejando tomar el
id lo quiero validar con la función ValidaComplemento() pero no toma encuenta el ID txtCodigoArticulo?

mi código es el siguiente


<script>
function ValidaComplemento()
{
if (document.getElementById("txtCodigoArticulo").value.trim() == "")
{
alert("Por favor ingrese el No. de la orden de compra.");
document.getElementById("txtCodigoArticulo").focus();

return false;
}
</script>


<asp:Repeater ID="repConceptos" runat="server">
<ItemTemplate>
<asp:TextBox ID="txtCodigoArticulo" runat="server" placeholder="Código articulo Min:1 Max:18" MinLength="1" MaxLength="18" OnClientClick="return ValidaComplemento()" CssClass="form-control form-control-sm art" style="background-color:#FBEFEF;" data-toggle="toltip" title="Es el codigo del articulo que CASA LEY tiene" onkeypress="return validarDecimal(event);" AutoComplete="off">
</asp:TextBox>
</ItemTemplate>
</asp:Repeater>


Continue reading...
 
Top Bottom