这是一个非常奇怪的问题,但由于某种原因,我的联系表格导致我的网站自动滚动到页面的中间。我不知道为什么要这样做......我所知道的是,当我删除联系表单代码时,它会正常加载,但我的网站需要这个表单(这是我得到的半自定义代码哈哈)
有什么想法和解决方案吗?这让我发疯了。:C
这是我的联系表格代码。另外,如果你们知道任何更好的方法来编码我在这里得到的东西(我相信有人会指出),我将不胜感激。:P
<div class="contact-form">
<!--Form on submit checks if the user used more than 5 words, thanks to the onsubmit function-->
<form method="post" action="process.php" onsubmit="var text = document.getElementById('message').value; if ($(this).find('textarea').val().match(/[a-z]+/gi).length < 5) { alert('Your Holler is too short. Try adding more words (min 5 words per message)'); return false; } return true;" >
<label for="name"><p>Name: <span class="required">*</span></p></label>
<input type="text" id="name" name="name" value="" placeholder="John Doe" required autofocus />
<label for="email"><p>Email Address: <span class="required">*</span></p></label>
<input type="email" id="email" name="email" value="" placeholder="johndoe@example.com" required />
<label for="telephone"><p>Telephone: </p></label>
<input type="tel" id="telephone" name="telephone" value="" />
<label for="enquiry"><p>Inquiry: </p></label>
<select id="enquiry" name="enquiry">
<option value="general">Freelance</option>
<option value="sales">Job Offering</option>
<option value="support">Requesting Resume</option>
<option value="support">Other</option>
</select>
<label for="message"><p>Message: <span class="required">*</span></p></label>
<textarea id="message" name="message" placeholder="Your message must be 5 words or more" required data-minlength="5"></textarea>
<input type="submit" id="submit" action="process.php" OnSubmit="window.open('', 'foo', 'width=450,height=300,status=yes,resizable=yes,scrollbars=yes')" value="Send My Holler!" class="submit-button" />
<p id="req-field-desc"><span class="required" style="color:#04B6DC;">*</span> indicates a required field</p>
</form>
</div> <!-- end contact-form -->