Form tag bug

Posted by Community Admin on 03-Aug-2018 04:44

Form tag bug

All Replies

Posted by Community Admin on 03-Nov-2010 00:00

Hi Telerik team,

Scenario A:
<body>
<form> *This is the page's form tag*
<div id="container">
<div id="left"></div>
<div id="main"></div>
</div>
</form>
</body>

I believe this is the default scenario so it's a given that everything will fall into place perfectly. Kindly take a look into this:

Scenario B:
<body>
<div id="container">
<div id="left"></div>
<form> *This is the page's form tag*
<div id="main">
<asp:ContentPlaceHolder ID="Content" runat="server" />
</div>
</form>
</div>
</body>

When I apply this mark-up, something goes wrong with the Edit Page view, the widgets, controls, they get mangled and disoriented as though they get "squeezed" into the page. Take a look at the screenshot attached. We have this requirement wherein we would be needing two form tags in the page. The page's default form tag has been inserted farther into the div's because another form tag is needed for the <div id="left"></div>.

Is this a bug?

Posted by Community Admin on 03-Nov-2010 00:00

Hello jkregala,

Thank you for using our services.

Each server side control needs to be added within a runat server form tag. The behavior you are experiencing is due to that reason. If you intend on using more than one form tags you should have the default form tag as usual and either nest the other one inside it or add it somewhere else. Please note that you cannot have more than one runat server form tag on a page at the same time.

Sincerely yours,
Radoslav Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 03-Nov-2010 00:00

Hi Radoslav Georgiev,

The form tag has a runat=server attribute already. Furthermore, our corporate website (which we are currently "Sitefinitizing") has a successful implementation of two server-side form tags. The primary difference between the two form tags is the action attribute used. Each of the two leads to an action destination different from the other.

Posted by Community Admin on 05-Nov-2010 00:00

Hello jkregala,

Could you please show us the markup you are trying to use. With the one from your first post there is no problem? How do you set the runat server property? Do you set it in markup, or dynamically? If I add two forms with runat="server" property set even if they have different actions I get the error message for duplicate form tags.

Greetings,
Radoslav Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 10-Nov-2010 00:00

Pardon me, only one form tag has the runat server attribute.

Anyway, here's the markup:

<body>
  <div id="header" />
  <div id="main">
    <div id="primary">
      <form id="aspnetForm" runat="server">
        *primary content here*
      </form>
    </div>
    <div id="secondary">
      <form id="search" action="/search/">
        <div>
          *search form here*
        </div>
      </form>
      <div>
        *other website elements here*
      </div>
    </div>
  </div>
  <div id="footer" />
</body>

As you can see the main form tag with IDaspnetForm is placed in the deeper layer of divs. If I do this, the initial error I reported with the screenshot happens.

Posted by Community Admin on 12-Nov-2010 00:00

Hello jkregala,

Could it be possible that you have a content place holder control in your page's header. You will not be able to add controls to areas which are not defined with content place holders.

Kind regards,
Radoslav Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 15-Nov-2010 00:00

Nope, there is no content placeholder control in the  <div id="header" /> part of the page. It only has the company logo and the main navigation (which is not a Sitefinity control, but a custom made one)

Posted by Community Admin on 17-Nov-2010 00:00

Hi jkregala,

Thank you for getting back to me.

I am still unable to reproduce the issue. Can you please open a bug report and send us a sample project where this issue reproduces?

All the best,
Radoslav Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed