theForm has no properties

Feb 2, 2009 at 7:03 AM
hello everyone

I am new at Facebook toolkit. I tried to add a form & a linkbutton in the IframeCanvasSample
But, when i click on the linkbutton, a javascript exception is thrown as following:

My sample code:

<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/FB_APP/IFrameMaster.Master" CodeFile="hotspot.aspx.cs" Inherits="FB_APP_hotspot" %>
<%@ Register Assembly="facebook.web" Namespace="facebook.web" TagPrefix="cc1" %>
<%@ MasterType VirtualPath="~/FB_APP/IFrameMaster.Master" %>
<asp:Content runat="server" ID="content" ContentPlaceHolderID="body">
<style>
...
</style>
  <form  runat=server>
<div class="container">
  ...
    <div>
    <ul class="ul_add_to">
        <li><asp:LinkButton CssClass="add_to" runat=server id=add_want_to_go
                onclick="add_want_to_go_Click">+Add to wish list</asp:LinkButton></li>

theForm has no properties
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {

it seems theForm is undefined in this case.

Does anyone encounter the sample issue?

Thank you

Feb 2, 2009 at 7:16 AM
Hello all

I tried a weird solution- added body tag, then it works
<asp:Content runat="server" ID="content" ContentPlaceHolderID="body">
<style>
...
</style>
<body>
  <form  runat=server>
<div class="container">
  ...
    <div>
    <ul class="ul_add_to">
        <li><asp:LinkButton CssClass="add_to" runat=server id=add_want_to_go
                onclick="add_want_to_go_Click">+Add to wish list</asp:LinkButton></li>
...
</body>

Does anyone know why?