Re: Javascript and $_POST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan Shirah wrote:
Jon,
Tried your method and still got:
*Error: Object doesn't support this property or method.
Code: 0*
*I don't know what browser/platform you're using, but the following works for me on IE7/Windows, FF2/Linux, Opera9/Linux.

jon

<html>
<head>
<script language="JavaScript">
function checkInputValue(item,onError) {
  if (item = document.getElementsByName(item)[0]) {
     if (item.value != "") {
        return(true);
     }
     item.focus();
  }
**   alert(onError);
  **return(false);*
*}

function checkForm() {
  elements = new Array('cc_phone_number');
  errors = new Array('Please enter a phone number');

  for (i=0;i<elements.length;i++) {
      if (!checkInputValue(elements[i],errors[i])) {
          return(false);
      }
  }

  document.getElementsByName('inputForm')[0].submit();
}
</script>
</head>
<body>
<form name="inputForm" method="post" enctype="multipart/form-data">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="680">
<tr>
<td><input type="text" name="cc_phone_number" />
</tr>
<tr>
<td width="64" align="left"><a href="#" onclick="javascript:checkForm();return(false);" title="Save">Save</a></td>
</tr>
</table>
</form>
</body>
</html>

*

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux