AEM6.3 coral form with action javascript issue

Avatar

Avatar
Validate 25
Level 4
srinivas_chann1
Level 4

Likes

21 likes

Total Posts

222 posts

Correct reply

6 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 4
srinivas_chann1
Level 4

Likes

21 likes

Total Posts

222 posts

Correct reply

6 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
srinivas_chann1
Level 4

31-08-2019

Hi ,

I am using AEM6.3 and using sling resource as granite/ui/components/coral/foundation/form. I need to have the java-script getting called to perform ajax call to servlet. But on page render the action is showing empty and hence cannot call java-script on submit . Please let me know o resolve it.

Have the below code

<form1

              granite:id="tag-edit-form"

              jcr:primaryType="nt:unstructured"

              sling:resourceType="granite/ui/components/coral/foundation/form"

             action="javascript:onsubmitprocess()"

              foundationForm="{Boolean}true"

              maximized="{Boolean}true"

              method="post"

              novalidate="{Boolean}true"

              style="vertical">

Note:- I could have called the servlet directly in action using something like /bin/servletcall  .But the problem i have is i need to show a dialog success on the page after successful  operation of servlet  hence thinking that using ajax will be better option.

Not sure how could i achieve it by directly calling servlet  in action

Thanks

Replies

Avatar

Avatar
Validate 25
Level 4
srinivas_chann1
Level 4

Likes

21 likes

Total Posts

222 posts

Correct reply

6 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 4
srinivas_chann1
Level 4

Likes

21 likes

Total Posts

222 posts

Correct reply

6 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
srinivas_chann1
Level 4

01-09-2019

Any inputs on this will be helpful

Avatar

Avatar
Give Back 5
MVP
Umesh_Sondhi
MVP

Likes

56 likes

Total Posts

64 posts

Correct reply

28 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 50
Boost 5
View profile

Avatar
Give Back 5
MVP
Umesh_Sondhi
MVP

Likes

56 likes

Total Posts

64 posts

Correct reply

28 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 50
Boost 5
View profile
Umesh_Sondhi
MVP

02-09-2019

Hi

srinivas channappa

You are calling servlet from forms action instead you have to call servlet on the click of submit .

Avatar

Avatar
Validate 25
Level 4
srinivas_chann1
Level 4

Likes

21 likes

Total Posts

222 posts

Correct reply

6 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 4
srinivas_chann1
Level 4

Likes

21 likes

Total Posts

222 posts

Correct reply

6 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
srinivas_chann1
Level 4

02-09-2019

Hi,

I would want to show a dialog on servlet response back to user like success or failure with custom message.Hence want to use javascript on action for ajax but action is not supporting action="javascript:onsubmitprocess()"

Could you please provide any sample code which i could use with

sling:resourceType="granite/ui/components/coral/foundation/form"

Thanks