cancel
Showing results for 
Search instead for 
Did you mean: 

handle data submit by a form

thinhnk
Champ on-the-rise
Champ on-the-rise
I face a problem when learn alfresco. I hope that someone can help me.
I create webscript including file test.post.json.js:

var email = json.get("email");
model.email = email;


and template response test.post.json.html to handle data from a form:

${email}


This is the form:

<form id="${args.htmlid}-form" action="/share/proxy/alfresco-noauth/metadata/modules/test" method="post">
    <div>
        <label>Email</label><input type="text" name="email" />
    </div>
    <div class="button-region bdft">
   <input type="submit" class="g-button" id="${args.htmlid}-ok" value="${msg("button.ok")}" />
   <input type="reset" class="g-button" id="${args.htmlid}-reset" value="${msg("button.reset")}" />
    </div>
</form>

But when submit the form, errors happen. I change the template response as follow:

<p>TEST<p>


no error, then I recognise that code inside test.post.json.js did not run at all. Smiley Sad I made what wrong? Please help me, even if this may be a silly question. Thank you very much!

2 REPLIES 2

dantuffery
Champ in-the-making
Champ in-the-making
"But when submit the form, errors happen"

What are the errors? Where are the errors reported in Share or Alfresco?

I solved this problem by make a test.js in client side to handle the response of server side. Thank you very much.