and in my jsp page. I tried to see ...">

How to use HTML field name in javascript if field name contains ".". (Point)?

I use <detail:form> and <tags:field > in my jsp page. I tried to see the source code that the browser generated using firebug, and it showed me that the form name is " checkForm " and all field names have "check." as a prefix. Thus, one of the fields (this is the name of the radio button) is check.isEndorseByApplicant .

What I am trying to achieve is when an item is selected in the drop-down menu, I wanted to change the switch from yes to no. The problem is that the field contains a dot in the name, I cannot do this. I document.checkForm.check.isEndorseByApplicant does not work for me. Currently, I cannot remove a point from the field name. Any ideas?

  function autoSelect(checkEndorsement) { alert(document.checkForm.check.isEndorseByApplicant) if(checkEndorsement.value=="Student") check.isEndorsedBy[0].checked=true; else check.isEndorsedBy[1].checked=true; } </html:javascript> 

. ,.

 <detail:form object="check" > 

. ,,.

 <td><tags:field property="isEndorseByApplicant" onclick="autoSelect(this.form);" /></td> 
+6
source share
1 answer

Use document.checkForm.elements['check.isEndorseByApplicant']

+5
source

Source: https://habr.com/ru/post/914343/


All Articles