Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Custom form component with slider and buttons |AEMasCS

Avatar

Level 3

Hi Team,
GP.png
We have a requirement to develop a form component similar to the above structure and look and feel for the end user to submit, as of now these fields values will be static but later business might come up different options/Questions. The form submission will return response from backend system. How to develop this component ?
Can we directly use Static html, CSS and JavaScript or should we pass field values through dialog  properties. and use Stylings  ? 

Thanks,
Geo

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

For me, I would re-use the AEM Core Form Components, and add style systems to match the styling as what you are showing us. 
for example, 
I can see 7 form elements on your page.

1. Form Text, seems standard, you can just overlay this component, and add some CSS to it to match your needs Form Text (aemcomponents.dev)

2.Form Text, seems standard, you can just overlay this component, and add some CSS to it to match your needs Form Text (aemcomponents.dev)
3 & 4. Form Options, you can just overlay this component, and style system to customize the CSS, Form Options (aemcomponents.dev) 

5. Form Slider, this should be a brand new component you should be creating, How To Create Range Sliders (w3schools.com)



For the form submission you can do it two ways. to just post to the form without javascript (making sure you have all form fields on the rendered page) or with javascript, sending the formData to the POST body.

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

For me, I would re-use the AEM Core Form Components, and add style systems to match the styling as what you are showing us. 
for example, 
I can see 7 form elements on your page.

1. Form Text, seems standard, you can just overlay this component, and add some CSS to it to match your needs Form Text (aemcomponents.dev)

2.Form Text, seems standard, you can just overlay this component, and add some CSS to it to match your needs Form Text (aemcomponents.dev)
3 & 4. Form Options, you can just overlay this component, and style system to customize the CSS, Form Options (aemcomponents.dev) 

5. Form Slider, this should be a brand new component you should be creating, How To Create Range Sliders (w3schools.com)



For the form submission you can do it two ways. to just post to the form without javascript (making sure you have all form fields on the rendered page) or with javascript, sending the formData to the POST body.

Avatar

Administrator

@georhe6 Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni

Avatar

Level 7

@georhe6 it is depend on what is the case here 

 

if ask to have an author experience where the author can add/remove fields or update style  the solution suggested by @BrianKasingli is good 

but if the ask does not have any author experience then the option without dialog can also work