javascript - Getting radio button group values using only CSJS -
I've read, but it does not really provide a customer-side solution.
I have a radio button group that determines whether other things will be visible or hidden or not I have code that will get value in this RB group's XP: script block.
getPTValue (bName) function {var pt = null; (var i = 0; i & lt; document.forms [0] .elements.length; i ++) {if (document.forms [0] .elements [i] .name == "# {id: PayType} ") {If (document.forms [0] .elements [i]. Checked == true) {pt = document.forms [0]. [Original] [Original]. value; break; // If it is removed for check boxes, groups and instead submit multiple values above}}} return pt} There is a radio button group;
& lt; xp: radio group id = "pay-type" value = "# {FInvoiceDoc.PayType}" defaultvalue = "hourly" style = "color: RGB (0,0,0)" & gt; & Lt; xp: Select item item label = "hourly" item value = "hourly" & gt; & Lt; / XP: selectItem & gt; & Lt; xp: Selection item item label = "fixed" item value = "fixed" & gt; & Lt; / xp: selectItem & gt; & Lt; xp: EventHill Folder Event = "OnClick" = "True" Refresh Modode = "Norfaces" & gt; & Lt; XP: this.script & gt; & Lt; [CDATA [payTypeVis ();]] & gt; & Lt; / XP: this.script & gt; & Lt; / XP: eventhandler & gt; & Lt; / XP: RadioGroup & gt; The document is in editing mode, but it is better, but if I open it in Readonly mode, then the above regular action is executed, but the value of the radio button group Does not return.
It appears that in the read-mode, this Patipee shows the radio-button group as a semi-math field. No buttons, only the price I try to get it from XSP.getElementById ("# {id: payType}"). InnerHTML and I get the price but with so many HTML tags around it. <.
Set the rendered property so that only the document If you are reading Waze, then: (See the reading fee ())! FInvoiceDoc.isEditable ();
Then in CSJs, check that the variable exists (i.e. you are in read mode), otherwise Get the price directly Dynamically with the radio button.
Comments
Post a Comment