DatePicker "SigningDate" fails on selecting date
Monday, October 11, 2021 at 02:26pmHi friends,
I have an issue with signing data from the web interface. DatePicker fails on open and I can`t select date.
Javascript error "TypeError: Cannot read properties of null (reading 'length')";
I using VS2019, C#, WebView2 component
string tempDir2 = Path.GetTempPath();
CoreWebView2EnvironmentOptions options = null;
CoreWebView2Environment webView2Environment = await CoreWebView2Environment.CreateAsync(null, tempDir2, options);
await webBrowser1.EnsureCoreWebView2Async(webView2Environment);
webBrowser1.Source = new Uri(url);
Reply to: DatePicker "SigningDate" fails on selecting date
Monday, October 11, 2021 at 02:29pmWinForms application. OneSpan web page several pages has DatePicker at the second page
Reply to: WinForms application…
Tuesday, October 12, 2021 at 09:21amHi LCG,
Thanks for your post! According to your description, it sounds like when your code defines the datepicker field, it didn't specify the date format (it's one of the field validation). If you are developing with .NET SDK, check below sample code:
FieldBuilder datepicker = FieldBuilder.Datepicker()
.WithValidation(FieldValidatorBuilder.Regex("YYYY-MM-dd").Required().WithErrorMessage("Please select a current or past date!"))
.OnPage(0)
.AtPosition(300, 300)
.WithSize(200, 55);
DocumentPackage package = PackageBuilder
.NewPackageNamed("Sample Package")
.WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]").WithFirstName("John").WithLastName("Smith"))
.WithDocument(DocumentBuilder.NewDocumentNamed("Document1").FromFile("your_file_path").WithId("DOCUMENT1")
.WithSignature(SignatureBuilder.SignatureFor("[email protected]")
.OnPage(0)
.AtPosition(100, 100)
.WithSize(200, 55)
.WithField(datepicker)
))
.WithStatus(DocumentPackageStatus.SENT)
.Build();
PackageId packageId = ossClient.CreatePackageOneStep(package);
Debug.WriteLine(packageId);
Duo
Reply to: Hi LCG, Thanks for your…
Tuesday, October 12, 2021 at 10:43amHi, Thank you for your reply.
We are not defining datepicker from the code. We are loading web page into web browser component Microsoft.WebView2.
https://apps.esignlive.com//auth?signerAuthenticationToken=[tokenExpired]&target=[someTarget]
Web page has an issue with loading js script or js package
Reply to: Hi, Thank you for your reply…
Tuesday, October 12, 2021 at 10:47amHi LCG,
I understood that you were experiencing the JS error when loading the Signing Ceremony in a web page, however, the issue was caused when the package first got created. Therefore, it could worth a check for that part of code.
Duo
Reply to: DatePicker "SigningDate" fails on selecting date
Tuesday, October 12, 2021 at 11:02amTry, let me check