- Home
- Forum
- Xamarin.Forms
- Input Value Error
Input Value Error
Hi.
How can i get input value ? when I try it: var WhatEmail = CustomerEmail.Value; show me error
My Xaml:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:inputLayout="clr-namespace:Syncfusion.XForms.TextInputLayout;assembly=Syncfusion.Core.XForms"
xmlns:maskededit="clr-namespace:Syncfusion.XForms.MaskedEdit;assembly=Syncfusion.SfMaskedEdit.XForms"
x:Class="InvoiceMPG.Pages.ReceiptPageAdd">
<ScrollView>
<StackLayout>
<StackLayout Padding="10,2,10,2">
<!--Email-->
<inputLayout:SfTextInputLayout
Hint="Email"
OutlineCornerRadius="8"
FocusedColor="DarkCyan"
UnfocusedColor="Gray"
Padding="5,0,5,0"
InputViewPadding="6"
ContainerType="Outlined">
<maskededit:SfMaskedEdit x:Name="CustomerEmail" Keyboard="Email" Mask="\w+@\w+\.\w+" MaskType="RegEx" ClearButtonVisibility="WhileEditing"/>
</inputLayout:SfTextInputLayout>
</StackLayout>
</ScrollView>
</ContentPage>
My Code Behind:
using System;
using Xamarin.Forms;
namespace InvoiceMPG.Pages
{
public partial class ReceiptPageAdd : ContentPage
{
public ReceiptPageAdd()
{
InitializeComponent();
LoadCustomers();
}
private async void LoadCustomers()
{
var WhatEmail = CustomerEmail.Value;
await DisplayAlert("OK", CualEmail, "Ok");
}
}
}
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
SS
Sridevi Sivakumar
Syncfusion Team
December 2, 2020 01:39 PM UTC
Hi EDGAR GARCIA,
Greetings from Syncfusion.
We have checked the reported problem with you provide code snippet, it has been worked fine without facing any error. Could you please share the faced problem while getting the value of MaskedEdit which is placed inside the TextInputLayout to analysis more and provide a possible solution?
For your information, SfTextInputLayout is just a container, so getting its content reference doesn’t make a error in your application.
Moreover, we have shared other possible way to get the Value of MaskedEdit
Greetings from Syncfusion.
We have checked the reported problem with you provide code snippet, it has been worked fine without facing any error. Could you please share the faced problem while getting the value of MaskedEdit which is placed inside the TextInputLayout to analysis more and provide a possible solution?
For your information, SfTextInputLayout is just a container, so getting its content reference doesn’t make a error in your application.
Moreover, we have shared other possible way to get the Value of MaskedEdit
Get the value from SfMaskedEdit ValueChanged event
https://help.syncfusion.com/xamarin/masked-entry/events#valuechanged-event
https://help.syncfusion.com/xamarin-android/sfmaskededit/validation#validation-mode
https://help.syncfusion.com/xamarin/masked-entry/events#valuechanged-event
https://help.syncfusion.com/xamarin-android/sfmaskededit/validation#validation-mode
By set the Value property through Binding, you can access the binding property to get the updated value
In your code snippet, you have display the CualEmail value in display alert but no more definition in your code. Could you please check whether because of that only , are you getting this error?
Please find the sample with your provided code snippet
https://www.syncfusion.com/downloads/support/forum/160235/ze/MaskSample-1258776870
Regards,
Sridevi S.
Please find the sample with your provided code snippet
https://www.syncfusion.com/downloads/support/forum/160235/ze/MaskSample-1258776870
Regards,
Sridevi S.
Marked as answer
EG
EDGAR GARCIA
December 2, 2020 04:40 PM UTC
Done, thanks
RS
Ramya Soundar Rajan
Syncfusion Team
December 3, 2020 05:29 AM UTC
Hi EDGAR GARCIA,
Thanks for your update.
Please get in touch with us if you would require any further assistance.
Regards,
Ramya S
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
- Marked answer
-
EG EDGAR GARCIA
- Dec 2, 2020 02:35 AM UTC
- Dec 3, 2020 05:29 AM UTC