Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    Code:
    <SCRIPT language=javascript type=text/javascript>
     function picktable(IndexNum)
     {
          Var HREF_Text = document.forms('TotalSQL').PATDATA.value;
          Var LeftNDX = 0;
          Var RightNDX = 0;
          int PassedNDX=IndexNum;
    
          for (int i = 1; i < PassedNDX; i ++){
             LeftNDX=HREF_Text.indexof(chr(2),LeftNDX+1);
          }
          RightNDX=HREF_Text.indexof(chr(2),LeftNDX+1);
          Var ActText = HREF_Text.substr(LeftNDX+1,RightNDX-LeftNDX);
     }
    </SCRIPT>
    
    ...
      <table stuff> ... <tr onClick=picktable('6')>  ... <other table stuff>
    gives the error type mis-match 'picktable'
    when I click on the row ...Note that 6 is the row number and changes from row to row. and that part works as shown below

    Code:
    <SCRIPT language=javascript type=text/javascript>
     function picktable(IndexNum)
     {
          //Var HREF_Text = document.forms('TotalSQL').PATDATA.value;
          //Var LeftNDX = 0;
          //Var RightNDX = 0;
          //int PassedNDX=IndexNum;
    
          //for (int i = 1; i < PassedNDX; i ++){
          //   LeftNDX=HREF_Text.indexof(chr(2),LeftNDX+1);
          //}
          //RightNDX=HREF_Text.indexof(chr(2),LeftNDX+1);
          //Var ActText = HREF_Text.substr(LeftNDX+1,RightNDX-LeftNDX);
          alert(IndexNum);
     }
    </SCRIPT>
    gives the correct response.
    What stupid thing am I doing wrong?
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    Your 6 is in quotes and is therefore being interpreted as a string. Take the single quotes out from around the 6 and you should be fine.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    NOpe. Apperently, the mismatch is not there. However, using this

    Code:
         Var HREF_Text = document.forms('TotalSQL').PATDATA.value;
          //Var LeftNDX = 0;
          //Var RightNDX = 0;
          //int PassedNDX=IndexNum;
    
          //for (int i = 1; i < PassedNDX; i ++){
          //   LeftNDX=HREF_Text.indexof(chr(2),LeftNDX+1);
          //}
          //RightNDX=HREF_Text.indexof(chr(2),LeftNDX+1);
          //Var ActText = HREF_Text.substr(LeftNDX+1,RightNDX-LeftNDX);
          alert(HREF_Text);
    give the error

    Code:
         //Var HREF_Text = document.forms('TotalSQL').PATDATA.value;
          //Var LeftNDX = 0;
          //Var RightNDX = 0;
          //int PassedNDX=IndexNum;
    
          //for (int i = 1; i < PassedNDX; i ++){
          //   LeftNDX=HREF_Text.indexof(chr(2),LeftNDX+1);
          //}
          //RightNDX=HREF_Text.indexof(chr(2),LeftNDX+1);
          //Var ActText = HREF_Text.substr(LeftNDX+1,RightNDX-LeftNDX);
          alert(document.forms('TotalSQL').PATDATA.value);
    give the correct response. I thought VAR meant string?
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    var means variable. As far as why you're still getting the error, I don't see it there myself.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    DerFarm, I suggest that you go out and get a good JS book (no offense, it just sounds like you're used to VB-like languages). I used "Teach Yourself Javascript in 24 Hours" but that's no longer available because it's for JS 1.3; instead check out these books from the same publisher: http://www.sams.com/catalog/index.as...D31266ACDE92}=
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  7. #6
    Senior Member nsr81's Avatar
    Join Date
    Oct 2002
    Posts
    1,132
    Member #
    250
    Liked
    15 times
    I'd suggest "Javascript the Definitive Guide", third edition by David Flanagan, published by O'reilly. The best JS reference book ever, covers 1.1 and 1.2.
    There and Back Again :Ogre:

  8. #7
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    Yeah, it's been a while since I did anything with C/Unix like stuff.

    What a pain.
    DerFarm
    I talk to squirrels.
    Squirrels Answer.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

java typemismatch script

,

javascript typemismatch

,

js password missmatch condition

,

js type mismatch

,

type mismatch error js

,

type mismatch in javascript

,

type mismatch javascript

,

type mismatch javascript error

,

type mismatch jscript

,

type mismatch number -2127352571 javascript

Click on a term to search for related topics.
All times are GMT -6. The time now is 08:53 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com