Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By pratyush
#782186
Hi All,

I have created a grid in which two fields which are drop down and textbox. The text box is dependent field of dropdown.
when i selected dropdown after this text box filled dropdown text not its value.

When i change the type of textbox on the page is 'hidden' and submitted it then i am not able to get this textbox POST value on the other page. It shows 'false'.
But when i not change the type of textbox and submitted then i'm able to get the POST value of textbox on other page.

Here on the other page i have copied the same grid, but can't find the POST value of hidden textbox.

Any solution would be appreciated.

Thanks
Pratyush
#782191
Hidden field should have a POST value, which is available in a trigger fired after the DynaForm:
$x = $_POST['form']['hidden-field'];
It should also be available as a case variable:
@@hidden-field

Can you post the XML code for the DynaForm which contains the hidden field. If it truly isn't POSTing the value, a workaround is to create a field as a normal text box, but use javascript in the DynaForm to set visible property to false:
getField('hidden-field').visible=false;
By pratyush
#782362
Hi Amosbatto,

Thanks a lot for your help.

below is my XML definition for master form--
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="51169043554a37b3e51d127072555830/78436245054f41ee695f786032150811" enabletemplate="0" type="xmlform" width="1366" mode="" nextstepsave="prompt" printdynaform="" adjustgridswidth="1">
<FormFilledByProjectCoordinator type="title" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Form Filled B yProject Coordinator</en>
</FormFilledByProjectCoordinator>
<CompleteProjectFormSubTitle type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Complete This Form</en>
</CompleteProjectFormSubTitle>
<ProjectID type="text" maxlength="64" validate="Any" required="0" readonly="0" size="20" mode="view" optgroup="0">
<en>Project Id</en>
</ProjectID>
<ClientDetailsubTitle type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Client Details</en>
</ClientDetailsubTitle>
<ClientName type="dropdown" required="0" readonly="0" optgroup="0" dependentfields="clientNm,ClientId,ClientAddress,ClientEmail,ClientContactNo" mode="view"><![CDATA[SELECT `id`,`customerName` FROM `CUSTOMERS` WHERE Cust_Status =1
]]><en>Name
<option name="0">--Select One--</option></en></ClientName>
<clientNm type="text" mode="edit" required="0" readonly="0" optgroup="0"><![CDATA[SELECT `customerName` FROM `CUSTOMERS` WHERE id= @=ClientName]]></clientNm>
<ClientId type="text" maxlength="64" validate="Any" required="0" readonly="0" size="20" mode="view" optgroup="0">SELECT customer_Id FROM CUSTOMERS WHERE id = @=ClientName<en>Client Id</en></ClientId>
<ClientAddress type="textarea" required="0" readonly="0" rows="4" cols="40" mode="view" optgroup="0">SELECT cust_address FROM CUSTOMERS WHERE id = @=ClientName<en>Address</en></ClientAddress>
<ClientEmail type="text" maxlength="64" validate="Email" required="0" readonly="0" size="40" mode="view" optgroup="0">SELECT cust_email FROM CUSTOMERS WHERE id = @=ClientName<en>Email</en></ClientEmail>
<ClientContactNo type="text" maxlength="64" validate="Any" required="0" readonly="0" size="20" mode="view" optgroup="0">SELECT contactNo FROM CUSTOMERS WHERE id = @=ClientName<en>Contact No</en></ClientContactNo>
<UploadBOQSubTitle type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Upload BOQ</en>
</UploadBOQSubTitle>
<UploadBOQFile type="file" required="0" readonly="0" optgroup="0">
<en>Upload BOQ</en>
</UploadBOQFile>
<UploadPOSubTitle type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Upload PO</en>
</UploadPOSubTitle>
<UploadPOStatus type="dropdown" required="0" readonly="0" optgroup="0" defaultvalue="0" mode="view">
<en>PO Upload
<option name="0">-- Select One--</option>
<option name="1">Yes</option>
<option name="2">No</option></en>
</UploadPOStatus>
<UploadPOFile1 type="file" required="0" readonly="0" optgroup="0">
<en>Upload PO</en>
</UploadPOFile1>
<Dategiven type="date" relativedate="0" startdate="2015-01-21" enddate="2015-01-28" mask="%Y-%m-%d" editable="0" required="0" readonly="0" defaultvalue_sel="empty" size="15" mode="view" optgroup="0">
<en>Date</en>
</Dategiven>
<SelectProductsSubTitle type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Select Products</en>
</SelectProductsSubTitle>
<SelProductsType type="dropdown" required="0" readonly="0" optgroup="0" mode="view">
<en>Product Type
<option name="0">--Select One--</option>
<option name="1">Single Type Product</option>
<option name="2">Multi Type Product</option></en>
</SelProductsType>
<SelSingleTypeProducts type="dropdown" required="0" readonly="0" optgroup="0" mode="view">
<en>Single Type Product
<option name="0">--Select One--</option>
<option name="1">Domestic</option>
<option name="2">VRF</option>
<option name="3">Ductable</option></en>
</SelSingleTypeProducts>
<SelMultiTypeProductss type="listbox" required="0" size="4" mode="view" readonly="0" optgroup="0">SELECT id, products_name FROM PRODUCTS
<en>Multi Type Product
<option name="0">--Select One--</option></en></SelMultiTypeProductss>
<AddBOQItemSubTitle type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Add BOQ Item</en>
</AddBOQItemSubTitle>
<BOQGrid type="grid" xmlgrid="51169043554a37b3e51d127072555830/76843298554f41ee699bda0024422998" addrow="1" deleterow="1" required="0" readonly="0" optgroup="0"/>
<OtherBOQItemSubTitle type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Other BOQ Item</en>
</OtherBOQItemSubTitle>
<OtherBOQItemGrid type="grid" xmlgrid="51169043554a37b3e51d127072555830/31831653554f41ee69d3f30048247590" addrow="1" deleterow="1" required="0" readonly="0" optgroup="0"/>
<AddProductInventoriess type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Add Product Inventories</en>
</AddProductInventoriess>
<AddProductDescriptionGrid type="grid" xmlgrid="51169043554a37b3e51d127072555830/86797765154b9e771e39e92099744540" addrow="1" deleterow="1" required="0" readonly="0" optgroup="0"/>
<AddProductContractorr type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Add Product Contractor</en>
</AddProductContractorr>
<ContractorGrid type="grid" xmlgrid="51169043554a37b3e51d127072555830/59978839754ead4dc4c75b6043197906" addrow="1" deleterow="1" required="0" readonly="0" optgroup="0"/>
<AddProductSupplierr type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Add Product Supplier</en>
</AddProductSupplierr>
<SupplierGrid type="grid" xmlgrid="51169043554a37b3e51d127072555830/28207903254b9e604f19270093551636" addrow="1" deleterow="1" required="0" readonly="0" optgroup="0"/>
<AddProjectCoordinatorSubTitle type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>Add Project Coordinator</en>
</AddProjectCoordinatorSubTitle>
<AddProjectCoordinator type="dropdown" required="0" readonly="0" optgroup="0" mode="view"><![CDATA[SELECT USR_UID, CONCAT(USR_FIRSTNAME, ' ', USR_LASTNAME) AS FULLNAME FROM USERS WHERE USR_ROLE = "PROCESSMAKER_PPROJECT_COORIDINAT"]]><en>Project Coordinator
<option name="0">--Please Select--</option></en></AddProjectCoordinator>
<ApprovedBOQ type="dropdown" required="0" readonly="0" optgroup="0" mode="view">
<en>Approved
<option name="0">--Select One--</option>
<option name="1">Yes</option>
<option name="2">No</option></en>
</ApprovedBOQ>
<BOQComments type="textarea" required="0" readonly="0" rows="4" cols="40" mode="view" optgroup="0">
<en>Comments</en>
</BOQComments>
<BOQApprovedByProjectHead type="subtitle" enablehtml="1" required="0" readonly="0" optgroup="0">
<en>BOQ Approved </en>
</BOQApprovedByProjectHead>
<SubmitForm3 type="submit" required="0" readonly="0" optgroup="0">
<en>Submit</en>
</SubmitForm3>
</dynaForm>



And below is my Grid XML definition

<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="51169043554a37b3e51d127072555830/76843298554f41ee699bda0024422998" enabletemplate="0" type="grid" width="500" mode="" nextstepsave="prompt" printdynaform="" adjustgridswidth="">
<MachineNo type="text" maxlength="64" validate="Any" required="0" readonly="0" size="10" mode="edit" optgroup="0">
<en>Machine No</en>
</MachineNo>
<SelProductsName type="dropdown" required="0" readonly="0" optgroup="0" dependentfields="SelProductModel" mode="edit">SELECT id, products_name FROM PRODUCTS<en>Product Name
<option name="0">--Select One--</option></en></SelProductsName>
<ProductNameValue type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT products_name FROM PRODUCTS WHERE id= @=SelProductsName<en>Product Name Value</en></ProductNameValue>
<SelProductModel type="dropdown" required="0" readonly="0" optgroup="0" dependentfields="SelProductsType" mode="edit">SELECT id, products_models FROM PRODUCTS_MODELS WHERE pro_Id= @=SelProductsName AND (CASE @=SelProductsName WHEN 1 THEN (id BETWEEN 1 AND 8) ELSE (id BETWEEN 13 AND 18) END)<en>Product Model
<option name="0">--Select One--</option></en></SelProductModel>
<ProductModelValue type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT products_models FROM PRODUCTS_MODELS WHERE id= @=SelProductModel<en>Product Model Value</en></ProductModelValue>
<SelProductsType type="dropdown" required="0" readonly="0" optgroup="0" dependentfields="SelProductsDescriptions" mode="edit">SELECT id, model_name FROM PRODUCTS_SPECIFICATIONS WHERE prMdl_Id= @=SelProductModel<en>Product Type
<option name="0">--Select One--</option></en></SelProductsType>
<ProductTypeValue type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT model_name FROM PRODUCTS_SPECIFICATIONS WHERE id= @=SelProductsType<en>Product Type Value</en></ProductTypeValue>
<SelProductsDescriptions type="dropdown" required="0" readonly="0" optgroup="0" dependentfields="BOQItemNameOne,BOQUOMONE,BOQItemNameTwo,BOQUOMTWO,BOQItemNameThree,BOQUOMTHREE,BOQUOMFOUR,BOQUOMFIVE,BOQUOMSIX,BOQUOMSEVEN,CopperPipeOneName,CopperPipeTwoName,InsulationSleeveOneName,InsulationSleeveNameTwo,InsulationSleeveNameThree,ProdWireName,PVC_Electrical_Conduit,PVC_Electrical_Bends,PVC_Drain,Elbows_And_Bends,Socket" mode="edit"><![CDATA[SELECT id, CONCAT(star_rating, '--', TR) AS STTR FROM PRODUCTS_INVENTORY_DESCRIPTION_TWO WHERE prodSpecificId= @=SelProductsType GROUP BY TR


]]><en>Description
<option name="0">--Select One--</option></en></SelProductsDescriptions>
<ProductDescriptionValues type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0"><![CDATA[SELECT CONCAT(star_rating, '--', TR) AS STTR FROM PRODUCTS_INVENTORY_DESCRIPTION_TWO WHERE id= @=SelProductsDescriptions]]><en>Product Description Values</en></ProductDescriptionValues>
<BOQItemNameOne type="text" maxlength="100" validate="Any" required="0" readonly="0" size="25" mode="edit" optgroup="0">SELECT BOQ_ITEM_ONE FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>BOQ Item One</en></BOQItemNameOne>
<BOQUOMONE type="text" maxlength="64" validate="Any" required="0" readonly="0" size="10" mode="edit" optgroup="0">SELECT BOQ_UOM_ONE FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>BOQ UOM ONE</en></BOQUOMONE>
<BOQItemNameTwo type="text" maxlength="64" validate="Any" required="0" readonly="0" size="25" mode="edit" optgroup="0">SELECT BOQ_ITEM_TWO FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>BOQ Item Two</en></BOQItemNameTwo>
<BOQUOMTWO type="text" maxlength="64" validate="Any" required="0" readonly="0" size="10" mode="edit" optgroup="0">SELECT BOQ_UOM_TWO FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>BOQ UOM TWO</en></BOQUOMTWO>
<BOQItemNameThree type="text" maxlength="100" validate="Any" required="0" readonly="0" size="25" mode="edit" optgroup="0">SELECT BOQ_ITEM_THREE FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>BOQ Item Three</en></BOQItemNameThree>
<BOQUOMTHREE type="text" maxlength="64" validate="Any" required="0" readonly="0" size="10" mode="edit" optgroup="0">SELECT BOQ_UOM_THREE FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>BOQ UOM THREE</en></BOQUOMTHREE>
<BOQItemFour type="dropdown" required="0" readonly="0" optgroup="0" dependentfields="BOQItemFourValue" mode="edit"><![CDATA[SELECT id, BOQ_ITEM_FOUR FROM BOQ_Description GROUP BY BOQ_ITEM_FOUR]]>
<en>BOQ Item Four
<option name="0">--Select One--</option></en>
</BOQItemFour>
<BOQItemFourValue type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT BOQ_ITEM_FOUR FROM BOQ_Description WHERE id= @=BOQItemFour<en>BOQ Item Four Value</en></BOQItemFourValue>
<BOQUOMFOUR type="text" maxlength="64" validate="Any" required="0" readonly="0" size="10" mode="edit" optgroup="0">SELECT BOQ_UOM_FOUR FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>BOQ UOM FOUR</en></BOQUOMFOUR>
<BOQItemFive type="dropdown" required="0" readonly="0" optgroup="0" dependentfields="BOQItemFiveValue" mode="edit">SELECT id, BOQ_ITEM_FIVE FROM BOQ_Description GROUP BY BOQ_ITEM_FIVE<en>BOQ Item Five
<option name="0">--Select One--</option></en></BOQItemFive>
<BOQItemFiveValue type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT BOQ_ITEM_FIVE FROM BOQ_Description WHERE id= @=BOQItemFive<en> BOQ Item Five Value</en></BOQItemFiveValue>
<BOQUOMFIVE type="text" maxlength="64" validate="Any" required="0" readonly="0" size="10" mode="edit" optgroup="0">SELECT BOQ_UOM_FIVE FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>BOQ UOM FIVE</en></BOQUOMFIVE>
<BOQItemSix type="dropdown" required="0" readonly="0" optgroup="0" dependentfields="BOQItemSixValue" mode="edit">SELECT id, BOQ_ITEM_SIX FROM BOQ_Description GROUP BY BOQ_ITEM_SIX<en>BOQ Item Six
<option name="0">--Select One--</option></en></BOQItemSix>
<BOQItemSixValue type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT BOQ_ITEM_SIX FROM BOQ_Description WHERE Id= @=BOQItemSix<en>BOQ Item Six Value</en></BOQItemSixValue>
<BOQUOMSIX type="text" maxlength="64" validate="Any" required="0" readonly="0" size="10" mode="edit" optgroup="0">SELECT BOQ_UOM_SIX FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>BOQ UOM SIX</en></BOQUOMSIX>
<BOQItemSeven type="dropdown" required="0" readonly="0" optgroup="0" dependentfields="BOQItemSevenValue" mode="edit"><![CDATA[SELECT id, BOQ_ITEM_SEVEN FROM BOQ_Description GROUP BY BOQ_ITEM_SEVEN]]><en>BOQ Item Seven
<option name="0">--Select One--</option></en></BOQItemSeven>
<BOQItemSevenValue type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0"><![CDATA[SELECT BOQ_ITEM_SEVEN FROM BOQ_Description WHERE Id= @=BOQItemSeven]]><en>BOQ Item Seven Value</en></BOQItemSevenValue>
<BOQUOMSEVEN type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT BOQ_UOM_SEVEN FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>BOQ UOM SEVEN</en></BOQUOMSEVEN>
<CopperPipeOneName type="text" maxlength="64" validate="Any" required="0" readonly="0" size="30" mode="edit" optgroup="0">SELECT Copper_Pipe_One FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>Copper Pipe One</en></CopperPipeOneName>
<CopperPipeOneQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</CopperPipeOneQty>
<CopperPipeTwoName type="text" maxlength="64" validate="Any" required="0" readonly="0" size="30" mode="edit" optgroup="0">SELECT Copper_Pipe_Two FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>Copper Pipe Two</en></CopperPipeTwoName>
<CopperPipeTwoQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</CopperPipeTwoQty>
<InsulationSleeveOneName type="text" maxlength="64" validate="Any" required="0" readonly="0" size="30" mode="edit" optgroup="0">SELECT Insulation_Sleeve_One FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>Insulation Sleeve One</en></InsulationSleeveOneName>
<InsulationSleeveOneQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</InsulationSleeveOneQty>
<InsulationSleeveNameTwo type="text" maxlength="64" validate="Any" required="0" readonly="0" size="30" mode="edit" optgroup="0">SELECT Insulation_Sleeve_Two FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>Insulation Sleeve Two</en></InsulationSleeveNameTwo>
<InsulationSleeveTwoQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</InsulationSleeveTwoQty>
<InsulationSleeveNameThree type="text" maxlength="64" validate="Any" required="0" readonly="0" size="25" mode="edit" optgroup="0">SELECT Insulation_Sleeve_Three FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>Insulation Sleeve Three</en></InsulationSleeveNameThree>
<InsulationSleeveThreeQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</InsulationSleeveThreeQty>
<ProdWireName type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT Wire FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>Wire</en></ProdWireName>
<WireQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</WireQty>
<PVC_Electrical_Conduit type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT PVC_ELECTRICAL_CONDUIT FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>PVC ELECTRICAL CONDUIT</en></PVC_Electrical_Conduit>
<PVC_Electrical_ConduitQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</PVC_Electrical_ConduitQty>
<PVC_Electrical_Bends type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT PVC_ELECTRICAL_BENDS FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>PVC ELECTRICAL BENDS</en></PVC_Electrical_Bends>
<PVC_Electrical_BendsQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</PVC_Electrical_BendsQty>
<PVC_Drain type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT PVC_DRAIN FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>PVC DRAIN</en></PVC_Drain>
<PVC_DrainQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</PVC_DrainQty>
<Elbows_And_Bends type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT Elbows_And_Bends FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>Elbows And Bends</en></Elbows_And_Bends>
<Elbows_And_BendsQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</Elbows_And_BendsQty>
<Socket type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" optgroup="0">SELECT Socket FROM BOQ_Description WHERE starTR_Id = @=SelProductsDescriptions<en>Socket</en></Socket>
<SocketQty type="text" maxlength="64" validate="Any" required="0" readonly="0" size="6" mode="edit" optgroup="0">
<en>Qty</en>
</SocketQty>
</dynaForm>




In the grid definition the fields which name ends with "value" word will be hidden fields i.e. "ProductModelValue, ProductDescriptionValues etc.."

currently i change the property of all "hidden" fields in "text".

Your help would be appreciated.


Thanks
Pratyush
Attachments
grid.jpg
grid.jpg (57.52 KiB) Viewed 4138 times
By pratyush
#782401
Hi Amosbatto,

As discussed earlier, you said that use JavaScript in the DynaForm to set visible property to false:-
getField('hidden-field').visible=false;

I use this JS code which is in PM Documentation.
Code: Select all
var dynaformOnload = function hideColumn() {
   var colNo = getGridField("BOQ", 1, "ProductNameValue").parentNode.cellIndex;   
   rows = document.getElementById(BOQ).rows;
   for (i=0; i < rows.length; i ++) {
      rows[i].cells[colNo].style.display= "none" ;
   }
}
When dynaform load than it alert a message "Cannot read property 'rows' of null".

and when i use "var rows = Number_Rows_Grid("BOQ", "ProductNameValue");" instead of " rows = document.getElementById(BOQ).rows;" then it shows nothing but not working. When i alert "rows.lenght" it shows "undefined".
Code: Select all
var dynaformOnload = function hideColumn() {  
   var colNo = getGridField("BOQ", 1, "ProductNameValue").parentNode.cellIndex;
   var rows = Number_Rows_Grid("BOQ", "ProductNameValue");   
  //G.alert(rows.lenght);
   for (i=0; i<=rows.lenght; i++) {     
      rows[i].cells[colNo].style.display= "none";
   }
}
Please suggest me that where i'm wrong.

Thanks

Pratyush
User avatar
By amosbatto
#782432
There are problems in both your code snippets:
In the first one, change:
Code: Select all
    rows = document.getElementById(BOQ).rows;
to:
Code: Select all
   rows = document.getElementById("BOQ").rows;
In the second one, change:
Code: Select all
  //G.alert(rows.lenght);
   for (i=0; i<=rows.lenght; i++) {
to:
Code: Select all
  //G.alert(rows.length);
   for (i=0; i<=rows.length; i++) {
By pratyush
#782433
Hi Amosbatto,

I have change in the code that you told but there is a problem i.e. the code is work fine but it show alert that "Cannot read property 'cells' of undefined"
i have send you my JS Code.


var dynaformOnload = function hideColumn() {
var display = "";
var colNo = "";
var rows = "";
colNo = getGridField("BOQG", 1, "ProductNameValue").parentNode.cellIndex;
rows = document.getElementById("BOQG").rows;
display = "none";

for(i=0; i<=rows.length; i++){
rows.cells[colNo].style.display=display;
}
}


Any solution would be appreciated.

Thanks

Pratyush

thanks a lot to tomolimo. I was able to download t[…]

Feeling the summer heat getting to you? ☀️ Don't l[…]

The Dell Memory Card Reader offers efficient data […]

Order Now : 👉 https://hydromorphone-pharmacy24x7[…]