user656925
user656925

Reputation:

running embedded javascript - a small test file

I've updated the code to reflect input.

<!doctype html>
<html lang="en">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <!-- <script type="text/javascript" src="../archelib.js"></script> -->
    <title>Test - Bookmark List</title>    
    <style>
  </style>
  </head>
  <body> 
  <span id="f0e"></span>
    <script type="text/javascript">


var arr1=['','a','b','c']
document.write(check_empty(arr1,'f0e','fail'));
function check_empty(text,id,res)
  {
  for(var d=0;d<text.length;d++)
    {
    if(text[d].value=='')
      {
      o2(id,res);
      return 0;
      }
    }
  return 1;
  }

function o2(a,b)
  {
  return document.getElementById(a).innerHTML=b;
  }

    </script>    
  </body>
</html>

Upvotes: 0

Views: 82

Answers (2)

user656925
user656925

Reputation:

Use type array for the input argument.

Upvotes: 1

Korvin Szanto
Korvin Szanto

Reputation: 4501

change

if(text[d].value=='')

to

if(text[d].value!='')

Upvotes: 0

Related Questions