make forms ajax for basic lessons

This commit is contained in:
lawson89
2014-08-07 17:44:49 -04:00
parent bef50d22b9
commit c306e338db
3 changed files with 45 additions and 35 deletions

View File

@ -63,7 +63,7 @@ public class HttpBasics extends LessonAdapter {
person = new StringBuffer(s.getParser().getStringParameter(PERSON, ""));
person.reverse();
Input input = new Input(Input.TEXT, PERSON, person.toString()+"RICK");
Input input = new Input(Input.TEXT, PERSON, person.toString());
ec.addElement(input);
Element b = ECSFactory.makeButton(WebGoatI18N.get("Go!"));

View File

@ -204,7 +204,8 @@ public abstract class Screen {
// TODO we could hook all forms here with javascript call to ajax forms plugin
public String getContent() {
return (content == null) ? "" : content.toString();
String makeFormsAjax = "<script> $(document).ready(function() { makeFormsAjax(); });</script>";
return (content == null) ? "" : content.toString() + makeFormsAjax;
}
/**