r8979@llin: dpavlin | 2005-11-20 00:39:43 +0100
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 19 Nov 2005 23:48:19 +0000 (23:48 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 19 Nov 2005 23:48:19 +0000 (23:48 +0000)
 another fix for checkboxes, added textarea, checkbox and radio buttons to
 tests

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@69 07558da8-63fa-0310-ba24-9fe276d99e06

web/iwf/iwfajax.js
web/iwf/testers/iwfajax.html
web/iwf/testers/iwfajaxpost.php

index d68e5c8..d6d5806 100644 (file)
@@ -275,9 +275,12 @@ function _iwfGetFormData(form, url, ctl){
                                case 'input':\r
                                        switch(iwfAttribute(el, 'type')){\r
                                                case 'checkbox':\r
+                                                       if (iwfAttribute(el, 'checked')){\r
+                                                               val = 'on';\r
+                                                       }\r
                                                case 'radio':\r
-                                                       if (iwfAttribute(el, 'checked') || el.checked){\r
-                                                               val = iwfAttribute(el, 'value') || el.value;\r
+                                                       if (iwfAttribute(el, 'checked')){\r
+                                                               val = iwfAttribute(el, 'value');\r
                                                        }\r
                                                        break;\r
                                                case 'button':\r
index f087cd8..befdc97 100644 (file)
                <a href='javascript:iwfMoveTo("moveme", 0, 0, 20); iwfShowGently("moveme", 5)'>reset orange box</a><br />\r
                <form action='iwfajaxpost.php' method='get' name='frmGet' iwfTarget='formSubmitResults'>\r
                        <input type='hidden' value='hidden get value' name='hidValue' />\r
+                       <textarea name="textarea_content" cols="30" rows="2">sample text area content</textarea>\r
+                       <br/><input type="checkbox" name="checkbox_test" /> checkbox\r
+                       <br/><input type="radio" name="radio_test" value="first radio button"> first\r
+                       <br/><input type="radio" name="radio_test" value="second radio button"> second\r
+                       <br/>\r
                        <input type='button' value='HTTP GET'  name='btnGet' onclick='javascript:iwfRequest(this);' />\r
                        <a href='javascript:iwfRequest("frmGet")'> GET via anchor</a>\r
                </form>\r
                <form action='iwfajaxpost.php' method='post' id='frmPost' iwfTarget='formSubmitResults'>\r
                        <input type='hidden' value='hidden post value' name='hidValue' />\r
+                       <textarea name="textarea_content" cols="30" rows="2">sample text area content</textarea>\r
+                       <br/><input type="checkbox" name="checkbox_test" /> checkbox\r
+                       <br/><input type="radio" name="radio_test" value="first radio button"> first\r
+                       <br/><input type="radio" name="radio_test" value="second radio button"> second\r
+                       <br/>\r
                        <input type='button' value='HTTP POST'  name='btnPost' onclick='javascript:iwfRequest(this);' />\r
                        <a href='javascript:iwfRequest("frmPost", "formSubmitResults")'> POST via anchor</a>\r
                </form>\r
                        If they show up here, there is problems!  iwfTarget is not being recognized...\r
                </div>\r
        </body>\r
-</html>
\ No newline at end of file
+</html>\r
index a4d775d..1e57615 100644 (file)
@@ -1,9 +1,19 @@
 <?\r
 require_once('../php/iwf.php');\r
+\r
+$now = gmdate("D, d M Y H:i:s");\r
+\r
+header( "Expires: Mon, 20 Dec 1998 01:00:00 GMT" );\r
+header( "Last-Modified: $now GMT" );\r
+header( "Cache-Control: no-cache, must-revalidate" );\r
+header( "Pragma: no-cache" );\r
+\r
 $iwf->popup($iwfTarget);\r
 $iwf->startHtml($iwfTarget);\r
 $iwf->pretty(true);\r
 \r
+echo "Generated on $now GMT<br/>";\r
+\r
 echo "<h1>GET</h1>";\r
 \r
 foreach($_GET as $key => $val){\r
@@ -21,4 +31,4 @@ echo $GLOBALS['HTTP_RAW_POST_DATA'] . "<br />";
 $iwf->endHtml(true);\r
 \r
 \r
-?>
\ No newline at end of file
+?>\r