Automate Uppercase Input in text Fields

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
dire
User
Posts: 41

Automate Uppercase Input in text Fields

Post by dire »

Hey,

I'm completely new at asp.net maker 2016 and C#

I'm trying to change text to Uppercase. My function in Global Code is
public void ConvertToUpperCase(String text)
{
string new_text = text.ToUpper();
}
And I add in Input tag attributes in Custom attributes "onchange='ConvertToUpperCase(this);'"

What is wrong?


Danny
User
Posts: 138

Post by Danny »

Hi,

Put this at row_inserting:

Uk_roepnaam means the example of the fieldname.

if (ew_Empty(rsnew["Uk_roepnaam"])) {
rsnew["Uk_roepnaam"] = rsnew["Uk_roepnaam"];
} else {
string var0 = Uk_roepnaam.CurrentValue.ToString();
string var1 = var0.TrimEnd();
string var2 = var1.TrimStart();
string var3 = var2.ToLower();
string var4 = var3.Substring(0, 1);
string var5 = var4.ToUpper();
rsnew["Uk_roepnaam"] = var5 + var3.Substring(1);
}

Regards,

Danny


lfernandes
User
Posts: 77

Post by lfernandes »

I applied the following line in the Field - Edit tag in custom attributes option "onkeyup =" this.value = this.value.toUpperCase (); '"


dire
User
Posts: 41

Post by dire »

Thx it works! Just some correction the correct code is

"onkeyup =' this.value = this.value.toUpperCase();'"


Post Reply