compare

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramirezzz
    New Member
    • Oct 2006
    • 4

    compare

    Hello!

    Can someone help me with this school work...

    JavaScript
    Make three 22 simbol txt fields and a button "Search". The 1st and 2nd fields are txt fields were You can write in. Like, in 1st I write "Source", but in 2nd I write "ou" and click "Search" button, it tells me true in 3rd field, but if I white in 2nd "gt", it tells me false in 3rd field! 2nd fields simbols must be in 1st, then it is true, but if not, then false...

    I don't know how to write this, I serched for some examples, but didn't find any...

    Thanks for Helping me :)
  • baden2500
    New Member
    • Oct 2006
    • 2

    #2
    [HTML]
    <html>
    <!-- see https://sourceforge.net/projects/jsconcise -->
    <body>
    <script type="text/javascript">
    function doSearch(){
    document.fo1.f3 .value = document.fo1.f1 .value.indexOf( document.fo1.f2 .value)>=0;
    }
    </script>
    <form name="fo1">
    <input type="text" name="f1"><br>
    <input type="text" name="f2"><br>
    <input type="text" name="f3"><br>
    <input type="button" name="f4" onclick="doSear ch()" value="search"> <br>

    </form>
    </body>
    </html>
    [/HTML]

    Comment

    • ramirezzz
      New Member
      • Oct 2006
      • 4

      #3
      Originally posted by baden2500
      <html>
      <!-- see https://sourceforge.net/projects/jsconcise -->
      <body>
      <script type="text/javascript">
      function doSearch(){
      document.fo1.f3 .value = document.fo1.f1 .value.indexOf( document.fo1.f2 .value)>=0;
      }
      </script>
      <form name="fo1">
      <input type="text" name="f1"><br>
      <input type="text" name="f2"><br>
      <input type="text" name="f3"><br>
      <input type="button" name="f4" onclick="doSear ch()" value="search"> <br>

      </form>
      </body>
      </html>
      thanx, but I don't know what to write down to get it work... In JavaScript I'm a lame! Can You give my the full code plzz?!?!?!?!

      Comment

      • YenRaven
        New Member
        • Oct 2006
        • 29

        #4
        Originally posted by ramirezzz
        thanx, but I don't know what to write down to get it work... In JavaScript I'm a lame! Can You give my the full code plzz?!?!?!?!
        from what i can see that is the whole code. :)

        Comment

        • ramirezzz
          New Member
          • Oct 2006
          • 4

          #5
          Originally posted by YenRaven
          from what i can see that is the whole code. :)
          IE Tell's me that there is an error in the code and FF don't tell anything... :( I don't know what to write in the code to get it working... :(

          Comment

          • ramirezzz
            New Member
            • Oct 2006
            • 4

            #6
            http://sds.e-home.lv/ko.php
            But it don't work :/

            Comment

            Working...