Storing data using static forms

arjuns71585267

13-02-2019

I am following this tutorial:

Adobe Experience Manager Help | Persisting Adobe Experience Manager 6.4 JCR data using a Custom Form...

Is there any way to get the data using normal input boxes from a page designed on static template and submit it into the jsp file POST.post.jsp. Here is the design and code of my page designed using static templates.

1690693_pastedImage_1.png

<H1>Enter employee details</h1>

<form action="/apps/eysample/components/structure/contentpage/processform.jsp">

  First name:<br>

  <input type="text" name="firstname">

  <br>

  Position:<br>

  <input type="text" name="position"><br>

  Office:<br>

  <input type="text" name="office">

  <br>

  Age:<br>

  <input type="text" name="age">

  <br>

  Date:<br>

  <input type="text" name="date">

  <br>

  Salary:<br>

  <input type="text" name="sal">

  <button type="submit">Submit</button>

</form>

I tried creating a copy of post.POST.jsp and referred it as shown in the code. Can anyone please help me out because my method is not working,

Accepted Solutions (1)

Accepted Solutions (1)

Gaurav-Behl

MVP

13-02-2019

use POST.jsp with this -

<form action="${resource.path}" enctype="multipart/form-data" name="subscribeForm" id="subscribeForm" method="POST"  onsubmit="return validate(this, rules);">

// form fields

</form>

Alternatively:

<script>

$(document).ready(function() {

$( "form" ).submit(function( event ) {

// do something

}

});

</script>

Answers (3)

Answers (3)

Gaurav-Behl

MVP

13-02-2019

Use <form method="POST" action="<somepattern>.post.<someextension> >......... </form> in your jsp/htl script and when you post your form it will submit to POST.jsp.

Alternatively, you could use jquery/js to submit the form.