简体   繁体   中英

Scripting HTML Using Visual Studio 2012 Express for Web

I entered some HTML scripts into VS 2012 Express and observed the following: An error message(line) that says: Validation(XHTML5): element 'li' cannot be nested inside element 'form'

  1. Is it possible to run an HTML script on the browser straight from the VS 2012 Express design window?

Here is my code:

<form class="contact_form" action="" method="post" name="contact_form">
<ul>
    <li>
         <h2>Contact Us</h2>
         <span class="required_notification">* Denotes Required Field</span>
    </li>
    <li>
        <label for="name">Name:</label>
        <input type="text" name="name" />
    </li>
</ul>
<li>
    <label for="email">Email:</label>
    <input type="text" name="email" />
    <span class="form_hint">Proper format "name@something.com"</span>
</li>
<li>
    <label for="website">Website:</label>
    <input type="text" name="website" />
    <span class="form_hint">Proper format "http://someaddress.com"</span>
</li>
<li>
    <label for="message">Message:</label>
    <textarea name="message" cols="40" rows="6" >
</li>
<li>
    <button class="submit" type="submit">Submit Form</button>
</li>

I have fixed it:

1.The textarea tag was not closed:

<textarea name="message" cols="40" rows="6" >
  1. Yes, I can run HTML script from the VS Express designer either by right clicking on the design tab or by using the Debug tool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM