English 中文(简体)
• 如何改变这一标题和文字,以便与6个不同的纽芬兰语和1个顿语合作
原标题:How to change this html and script to work with 6 different buttons vs 6 radio & 1 button

I m在重新设计网页上工作,而I ve在6种选择中增加了6个不同县,用户可以选择而不是6个无线电箱和邮袋;1个顿。 我只需要调整该守则,以确保在下页,右面和文字的展示依据的是荷兰的推动。

我只需要下页的某些案文,才能根据哪一个县受到压力而改变。

Here is what was there originally:

<input id="diamondmonthly" class="radio" type="radio" value="diamondmonthly" name="membership">

<input id="diamondyearly" class="radio" type="radio" checked="checked" value="diamondyearly" name="membership">

<input id="c4" class="radio" type="radio" value="c4" name="membership">

<input id="c3" class="radio" type="radio" value="c3" name="membership">

<input id="c2" class="radio" type="radio" value="c2" name="membership">

<input id="c1" class="radio" type="radio" value="c1" name="membership">

<a id="btnSave" class="xlarge button-submit" onclick="$j( #btnSave ).attr( disabled ,  disabled );qc.recordControlModification( btnSave ,  Enabled ,  0 ); qc.pB( MembershipForm ,  btnSave ,  QClickEvent ,   );" href="#">

<script>
//<![CDATA[
qc.registerForm(); qc.imageAssets = "http://images.comfiles.com/assets/images"; qc.cssAssets = "http://images.comfiles.com/assets/css"; qc.phpAssets = "/assets/php"; qc.jsAssets = "http://images.comfiles.com/assets/js"; qc.regCA(new Array("btnSave","btnSave2","c1","c2","c3","c4","diamondyearly","diamondmonthly")); jQuery(document).ready(function($j){if($j.isFunction($j().tooltip)){$j("#MembershipForm :input[data-error]").tooltip({ position: "center right", tipClass: "error_tooltip", offset: [0, -4] })}}); 
//]]>
</script>
最佳回答

可以通过每个县的一位听众来处理这一问题,或者把工作交给单一祖先。 在该案中,就表格单独点击听众可能最容易。 在发出呼吁时,你可以使用相关的活动物体,看它来自何处,并相应作出反应。

Note that when getting form controls by name, if only a single control has that name then only a single element is returned. If two or more controls have the name, then a HTMLCollection of the elements with that name is returned.

听众可以这样说:

<form onclick="handleClick(this)" ...>

听众(未经测试,但你应当能够从这里获得):

function handleClick(form) {
  var button, buttons = form[ membership ];

  // Now show text depending on which membership button is checked
  for (var i=0, iLen=buttons.length, i<iLen; i++) {
      button = buttons[i];

      // Assuming that the text element to display has an ID 
      // matching the value of the checked button
      if (button.checked) {
        document.getElementById(button.value).style.display =   ;
      } else {
        document.getElementById(button.value).style.display =  none ;
      }
  }
}

每次打上标本的任何地方时,都会打上标本,因此,即便点击了重新编号的纽特,也总是展示正确的文字。

如果是:

      document.getElementById(button.value).style.display = button.checked?    :  none ;

但较长的版本可能更清楚。

奥赫,在文字要素中排除了CDATA的限定者,只需要作为XML的文件。

问题回答

暂无回答




相关问题
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!

热门标签