English 中文(简体)
2. 只使用箱子向集装箱顶端移动部件
原标题:Move elements to top of container using only css
  • 时间:2012-04-05 00:56:36
  •  标签:
  • html
  • css

http://happyjs.com/“rel=“nofollow”>happy.js。 出现错误时,“不申请豁免”类的间隔将直接放在没有通过确认的形式要素之前。 . . . .

<form id="myForm">
  <label for="text1">Label 1</label><br />
  <span id="text1_unhappy" class="unhappyMessage">Error message</span>
  <input id="text1" type="text" />
  <br />
  <label for="text2">Label 2</label><br />
  <span id="text2_unhappy" class="unhappyMessage">Error message</span>
  <input id="text2" type="text" />
</form>

<代码><span>s在出现错误之前没有显示。 我愿使用剪辑,以某种方式向上级传递错误信息:as,如果 贴上这样的标签:

<form id="myForm">
  <span id="text1_unhappy" class="unhappyMessage">Error message</span><br />
  <span id="text2_unhappy" class="unhappyMessage">Error message</span><br />
  <label for="text1">Label 1</label><br />
  <input id="text1" type="text" />
  <br />
  <label for="text2">Label 2</label><br />
  <input id="text2" type="text" />
</form>

请注意,我拟将每一条<代码>.unhappyMessage也放在自己的行文上。 是否只有这样做?

说明:对于你们当中的人们来说,我只想使用 c子,因为我不得不做一些反向工程,以便用 j子进行这项工作,因为它似乎是通过快乐提供的唯一事件。 j 不是生成错误信息的唯一时间。

最佳回答

胜地为你们提供了解决办法。 如果你无法轻易进入活动代表团,请另一名有效人选。 或者看看一下该守则,看看看你是否能够把工作推到一起。

Edit:
looking at the happy.js page it provides a callback function for you to specify if you wish.

unHappy (function): A callback that gets triggered when form submission is attempted but any fields fail validation.

So pass a function that prepends all the error messages.

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!