PDA

View Full Version : Get sets of sequential component value using javascript



josephmkchan
Dec 16, 2021, 7:45 AM
Dear Support,

Just want to add a javascript checking by the handler function in the listener from the component like a sets of text field like Textbox1, Textbox2, Textbox3....

I would like to use a loop of checking their values for duplicate entry, but don't want to be hardcode App.Textbox1.getValue(), App.Textbox2.getValue().....

Can I use something like this below CodeBehind script method but now in javascript syntax inside listener handler in client side?



string checkstring="abc";
for (count=1; count < 10; count++)
{
var text = X.GetCmp<TextField>("Textbox"+count.ToString() );
pd[count].Text = text.Value.ToString();
if pd[count].Text == checkstring
{
//prompt error
}
}