format.xrw 5.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>Untitle</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <input01/>
  11. <input02/>
  12. <input03/>
  13. <input04/>
  14. <input05/>
  15. <input06/>
  16. </main>
  17. </root>
  18. </instance>
  19. </model>
  20. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  21. </xhtml:head>
  22. <xhtml:body>
  23. <input id="input1" ref="/root/main/input01" imemode="disabled" format="999-999" style="left:120px; top:60px; width:100px; height:19px; "/>
  24. <caption id="caption3" class="tit_1" style="left:0px; top:0px; width:422px; height:14px; vertical-align:middle; ">format</caption>
  25. <caption id="caption2" class="cell_1" style="left:20px; top:60px; width:72px; height:20px; font-weight:bold; ">우편번호</caption>
  26. <caption id="caption4" style="left:250px; top:60px; width:130px; height:20px; ">input@foramt="999-999"</caption>
  27. <caption id="caption5" class="cell_1" style="left:20px; top:120px; width:72px; height:20px; font-weight:bold; ">주민번호</caption>
  28. <caption id="caption6" style="left:250px; top:120px; width:172px; height:20px; ">input@foramt="999999-9999999"</caption>
  29. <input id="input2" ref="/root/main/input02" imemode="disabled" format="999999-9999999" style="left:120px; top:120px; width:100px; height:19px; "/>
  30. <line id="line1" style="x1:20px; y1:95px; x2:420px; y2:95px; "/>
  31. <line id="line2" style="x1:20px; y1:160px; x2:420px; y2:160px; "/>
  32. <caption id="caption1" class="cell_1" style="left:20px; top:180px; width:72px; height:20px; font-weight:bold; ">금 액</caption>
  33. <line id="line4" style="x1:20px; y1:235px; x2:420px; y2:235px; "/>
  34. <caption id="caption7" style="left:250px; top:180px; width:172px; height:20px; ">input@foramt="#'###"</caption>
  35. <input id="input3" ref="/root/main/input03" imemode="disabled" format="#,###" style="left:120px; top:180px; width:100px; height:19px; "/>
  36. <caption id="caption9" class="cell_1" style="left:20px; top:290px; width:72px; height:20px; font-weight:bold; ">전화번호</caption>
  37. <input id="input4" ref="/root/main/input04" imemode="disabled" style="left:120px; top:290px; width:100px; height:19px; ">
  38. <script type="javascript" ev:event="xforms-value-changed">
  39. <![CDATA[
  40. var pattern = /^0\d{1,2}\-\d{3,4}\-\d{4}$/ig;
  41. var inputValue = model.getValue("/root/main/input04");
  42. if( pattern.exec(inputValue) == null ) {
  43. messageBox("전화번호 형식이", "E004");
  44. var ctrlID = event.target;
  45. var crtlObj = document.controls.item(ctrlID);
  46. crtlObj.value = "";
  47. model.setFocus(ctrlID);
  48. }
  49. ]]>
  50. </script>
  51. </input>
  52. <caption id="caption10" style="left:250px; top:290px; width:184px; height:20px; ">0\d{2,3}\-\d{3,4}\-\d{4}</caption>
  53. <line id="line5" style="x1:20px; y1:330px; x2:420px; y2:330px; "/>
  54. <caption id="caption11" style="left:20px; top:245px; width:480px; height:20px; font-weight:bold; ">* 아래와 같이 자릿수가 정해지지 않은 입력형식에는 정규식을 이용합니다.</caption>
  55. <caption id="caption12" style="left:250px; top:350px; width:192px; height:20px; ">01[016789]\-\d{3,4}\-\d{4}</caption>
  56. <input id="input5" ref="/root/main/input05" imemode="disabled" style="left:120px; top:350px; width:100px; height:19px; ">
  57. <script type="javascript" ev:event="xforms-value-changed">
  58. <![CDATA[
  59. var pattern = /^01[016789]\-\d{3,4}\-\d{4}$/ig;
  60. var inputValue = model.getValue("/root/main/input05");
  61. if( pattern.exec(inputValue) == null ) {
  62. messageBox("후대폰번호 형식이", "E004");
  63. var ctrlID = event.target;
  64. var crtlObj = document.controls.item(ctrlID);
  65. crtlObj.value = "";
  66. model.setFocus(ctrlID);
  67. }
  68. ]]>
  69. </script>
  70. </input>
  71. <line id="line3" style="x1:20px; y1:390px; x2:420px; y2:390px; "/>
  72. <caption id="caption13" class="cell_1" style="left:20px; top:350px; width:72px; height:20px; font-weight:bold; ">휴대폰번호</caption>
  73. <input id="input6" imemode="disabled" format="yyyy-mm-dd hh:nn:ss" style="left:165px; top:400px; width:175px; height:19px; "/>
  74. <caption id="caption8" class="tit_2" style="left:25px; top:30px; width:405px; height:13px; ">날짜, 숫자 포맷 적용시 imemode="disabled" 함께 적용 해야 함</caption>
  75. <caption id="caption14" class="cell_1" style="left:20px; top:400px; width:139px; height:20px; ">yyyy-mm-dd hh:nn:ss</caption>
  76. <input id="input7" maxlength="4.2" format="#,###.00" style="left:630px; top:60px; width:100px; height:19px; "/>
  77. <caption id="caption15" class="cell_1" style="left:480px; top:60px; width:141px; height:20px; ">소수점 2자리까지만 입력</caption>
  78. <caption id="caption16" class="tit_2" style="left:475px; top:35px; width:342px; height:14px; ">'0' 표기는 포맷 적용시 maxlength를 함께 적용해야 함</caption>
  79. <line id="line6" style="x1:20px; y1:435px; x2:420px; y2:435px; "/>
  80. <caption id="caption17" style="left:250px; top:205px; width:172px; height:20px; ">input@foramt="(-)#'###"(음수)</caption>
  81. <input id="input8" ref="/root/main/input06" imemode="disabled" format="(-)#,###" style="left:120px; top:205px; width:100px; height:19px; "/>
  82. <input id="input9" format="999999" style="left:440px; top:120px; width:100px; height:19px; "/>
  83. <input id="input10" autonext="false" format="9999999" style="left:550px; top:120px; width:100px; height:19px; "/>
  84. </xhtml:body>
  85. </xhtml:html>