Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Wizard with validation in Angular


Hello,

Angular - Demo 1

I am working on the wizard and was trying to use formGroup with Validations.
Trying to use markAllasTouched or any control or form methods inside change event of the wizard which is not working fine.

Can you guys please help me out in this? am I doing something wrong? or is this a bug in the event triggering or may be it is JavaScript?

Thanks,
DP


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


I had a similar issue not long ago. When using markAllAsTouched() inside the change event of a wizard step, it didn’t always work as expected either. I found that wrapping it in a setTimeout helped, probably because the view needs a moment to update before the validation kicks in. Also, double-check that your formGroup and all controls are properly initialized before calling any methods on them. It’s not necessarily a bug, just how Angular timing works sometimes. Hope that helps!



Hi,

Try to call changeDetection after using markAllasTouched,
Here is the more details:

Regards,
Keenthemes support



Here is the stackoverflow question link as well.

<a>


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(