Last change
on this file since 874 was
874,
checked in by duh, 13 years ago
|
- Resolved issue #66, marking required fields in wizard
|
-
Property svn:keywords set to
Date Author Rev
|
File size:
1.3 KB
|
Line | |
---|
1 | <% |
---|
2 | /** |
---|
3 | * Wizard error template |
---|
4 | * |
---|
5 | * @author Jeroen Wesbeek |
---|
6 | * @since 20100114 |
---|
7 | * @package wizard |
---|
8 | * @see dbnp.studycapturing.WizardTagLib |
---|
9 | * @see dbnp.studycapturing.WizardController |
---|
10 | * |
---|
11 | * Revision information: |
---|
12 | * $Rev: 874 $ |
---|
13 | * $Author: duh $ |
---|
14 | * $Date: 2010-09-08 11:17:25 +0000 (wo, 08 sep 2010) $ |
---|
15 | */ |
---|
16 | %> |
---|
17 | <g:if test="${errors}"> |
---|
18 | <div id="wizardError" class="error" title="errors"> |
---|
19 | <g:each in="${errors}" var="error" status="e"> |
---|
20 | <p> |
---|
21 | <g:if test="${!e}"><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 50px 0;"></span></g:if> |
---|
22 | ${error.value['key']} → ${error.value['value']} |
---|
23 | </p> |
---|
24 | </g:each> |
---|
25 | </div> |
---|
26 | <script type="text/javascript"> |
---|
27 | // mark error fields |
---|
28 | <g:each in="${errors}" var="error"> |
---|
29 | var element = $("input:[name='${error.key}'], input:[name='${error.key.toLowerCase().replaceAll("([^a-z0-9])","_")}'], select:[name='${error.key}'], select:[name='${error.key.toLowerCase().replaceAll("([^a-z0-9])","_")}']"); |
---|
30 | <g:if test="${error.value['dynamic']}"> |
---|
31 | element.addClass('error'); |
---|
32 | </g:if><g:else> |
---|
33 | element.parent().parent().removeClass('required'); |
---|
34 | element.parent().parent().addClass('error'); |
---|
35 | </g:else> |
---|
36 | </g:each> |
---|
37 | |
---|
38 | // show error dialog |
---|
39 | var we = $("div#wizardError"); |
---|
40 | we.dialog({ |
---|
41 | modal: true, |
---|
42 | width: 600, |
---|
43 | buttons: { |
---|
44 | Ok: function() { |
---|
45 | $(this).dialog('close'); |
---|
46 | we.remove(); |
---|
47 | } |
---|
48 | } |
---|
49 | }); |
---|
50 | </script> |
---|
51 | </g:if> |
---|
Note: See
TracBrowser
for help on using the repository browser.