#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    3
    Rep Power
    0

    "object does not support... " javascript error when handling 2 forms


    I keep getting the "Object does not support property or method" error. Already tried most solutions from the net but it's still not working. hope you guys could help me out.

    here's the code:

    <html>
    <head>
    <title>Search for Business Process Document</title>
    </head>

    <script language="JavaScript">
    <!--
    function submitSearch()
    {
    document.form1.submit();
    }

    function submitLink()
    {
    document.form2.submit();
    }

    //-->
    </script>

    <body bgcolor="#FFFFFF">
    <form name=form1 action=bp.asp method=post>

    <table width="90%" border="0" align="center">
    <tr>
    <td align=right> <table width="90%" border="0" align="center">

    <tr>
    <td colspan="3"> <br>

    <table width="100%" border="0" align="center">
    <tr>
    <td>
    <div align="left"><font size="3" color="#000066" face="Verdana, Arial, Helvetica, sans-serif"><b>Business
    Process Documents</b></font></div>
    </td>
    <td width="50%">
    <div align="right">
    <input type="text" name="pname">
    <input type="button" name="searchbtn" value="Search" onClick="submitSearch();">
    </div>
    </td>
    </tr>
    </table>
    <hr>
    </form>
    </td>
    </tr>

    <form name=form2 action=view_document.asp action=post>
    <tr>
    <input type=hidden value=<%= rs("index_num")%>>
    <td><a href="#" OnClick="submitLink();"><font face=verdana size=2><b><%= rs("doc_title")%></td>
    <td width="5">&nbsp;</td>
    <td align=right><font face=verdana size=2><b><%= rs("date_uploaded")%></td>
    </tr>
    </form>

    </table>
    </td>
    </tr>
    </table>

    </body>
    </html>


    ----------------------
    code is kinda messed up. I'm pretty much a beginner in ASP. Thanks for the help!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Ashburn,VA
    Posts
    105
    Rep Power
    12
    interestingly, I dont have any trouble submitting the forms. I tried to run yoru script as it is on my machine. it works like a gem.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Canada, Quebec, Montreal
    Posts
    410
    Rep Power
    12
    First thing, what is the EXACT error message?

    I don't want your interpretation of the error message, show us the error message with the error line...


    Second thing, you are NOT showing us the relevant code, for example, where do you declare your variable RS ?

    Hope this helps!
    Sincerely

    Vlince
  6. #4
  7. Just another guy
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Jun 2003
    Location
    Wisconsin
    Posts
    2,953
    Rep Power
    262
    You can't have 2 actions for your form 2. Change "<form name=form2 action=view_document.asp action=post> " to "<form method="post" name="form2" action="view_document.asp">
    Also, <form name="form1" action="bp.asp" method="post">
    Last edited by karsh44; August 19th, 2003 at 09:00 AM.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Canada, Quebec, Montreal
    Posts
    410
    Rep Power
    12
    Good catch...didn't see the two action attributes...probably why he's/she's getting the error message!

    Vlince
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    3
    Rep Power
    0
    Got it working. Thanks guys!

IMN logo majestic logo threadwatch logo seochat tools logo