javascript - Check All Radio Buttons (JSF Component) + jQuery -


I have a form in which I am creating a figure, each line has a set of components and one of them :

  & lt; H: Selectiononeredio id = "chargweave" onclick = "alert (this.id);" & Gt; & Lt; F: Selection item item label = "charge" item value = "charge" /> & Lt; F: Selection item item label = "sorry" item value = "discount" /> & lt; / H: selectOneRadio & gt;   

I have added two links that trigger two similar functions:

   & Lt; / A & gt; & Lt; A href = "#" onclick = "allwiki ();" & Gt; & Lt; H: output text value = "skip all" /> & Lt; / A & gt;   

So when the user clicks on the link, then all charges / radiobatons should be charged.

Before using the radio button (test purpose) one of the following codes, I always get the same error:

  $ ('# frmResults: billingRecordId: 0 : ChargeWaive: 0 '). Attr ('checked', true); $ ('# FrmResults: billingRecordId: 0: chargeWaive: 0'). Ether ('check', 'check'); $ ('# FrmResults: billingRecordId: 0: chargeWaive: 0'). Prop ("check", true);   

The error I am getting is: Syntax error, unrecognized expression: Billing record ID

I know that the ID is correct because When I see the compiled JSF code in the generated ID for the Radio type:

  & lt; Input type = "radio" name = "frmResults: billingRecordId: 0: ChargeWaive" id = "frmResults: billingRecordId: 0: chargeWaive: 0" value = "fee" onclick = "warning (this.id);" / & gt; & Lt; Label = "frmResults: billingRecordId: 0: chargeWaive: 0" & gt; In charge & lt; / Labels & gt; & Lt; Input type = "radio" name = "frmResults: billingRecordId: 0: chargeWaive" id = "frmResults: billingRecordId: 0: chargeWaive: 1" value = "leave" onclick = "warning (this.id);" / & Gt; & Lt; For label = "frmResults: billingRecordId: 0: chargeWaive: 1" & gt; Sorry & lt; / Labels & gt;   

So at the moment I do not know what I'm remembering here any thoughts?

jQuery uses HTML DOM to select elements in the tree.

: There is a special character representing the beginning of the CSS selector. So if you're looking for an HTML element with frmResults then

  $ ('# frmResults: billingRecordId')   

Use and a pseudo-class match billingRecordId However, as billingRecordId is not a valid pseudo class, nothing will be found.

You need to basically avoid the colon in the CSS selector syntax.

  $ ('# frmResults \\: billingRecordId \\: 0 \\: chargeWaive \\: 0')   

Or, IMO cleaner, < Code> use [id] attribute selector.

  $ ('[id = "frmResults: billingRecordId: 0: chargeWaive: 0"]')   

Or, get rid of the infected id and indexed for.

  $ ('[id $ =': chargeWaive]]: first: radio: first ')   

(on " Select elements with an ending ID: In charge wive , get first, get radio button first again))

Also see:

  • As a completely different option, you can also call JSF ajax, so you can set the desired radio boots. According to according to Ajinke Srut of Backing Bean Method.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -