NetSuite Suitelet Custom HTML | Pressing submit on the form causes the value to be null

644 views Asked by At

I am creating a suitelet using custom HTML. The page displays fine, but on submit, I am not able to get the parameter values.

    html = html + "<div class='row row_1'>";
    html = html + "<select onchange='onItemSelect(event)' class='item_select'   name='item_1'>";
    html = html + "</select>";
    html = html + "<input name='quantity' placeholder='Quantity' type='number' />";
    html = html + "<input  name='svuuom' disabled placeholder='SVU UOM' type='text' />";
    html = html + "<input  name='qtysvuuom' disabled placeholder='Qty in SVU UOM' type='text' />";
    html = html + "<input  name='lot_num' placeholder='Lot Number' type='text' />";
    html = html + "<input  name='exp_date' placeholder='Expiration Date' type='date' />";
    html = html + "<input  onChange='calcQtyRemain(event)' name='ac_weight' placeholder='Actual Weight' type='text' />";
    html = html + "<input  name='averageweight' disabled placeholder='Average Weight' type='number' />";
    html = html + "<input  name='totalqty' disabled placeholder='Total Quantity' type='text' />";
    html = html + "<input  name='qtyremaining' disabled placeholder='Quantity Remaining' type='text' />";
    html = html + "<button  class='row_1 remove nav_button' onClick='removeRow(this)'>Remove</button>";
    html = html + "<input type='hidden' name='submit_data' id='submit_data'  ></input>";
    html = html + "</div>";
    html = html + "<button  class='nav_button' type='submit' >Submit</button>";
    html = html + "<button id='finalize' class='nav_button' onClick='finalizeForm(event)'> Finalize</button>";
    html = html + "<button class='nav_button' onClick='addRow()' class='add_row'>Add Row</button>";
    html = html + "<script src='https://6511345.app.netsuite.com/core/media/media.nl?id=3240&c=6511345&h=g_fi0R_eVH-pDCr9pidg6_RMLQc"+
    "A-ySTQOWrhs3FYIL3NVkc&_xt=.js' /></script>";
    html = html + "</form>";

The value is being set to the hidden field 'submit_data' when the user clicks finalize. I want to grab this as a parameter on post. If I set the value='Test' on the submit_data field, I get the parameter just fine on post. The above code is on the get request. I am also linking JS files and doing some client side functions within that. These functions set the value on submit_data field.

1

There are 1 answers

0
Mike A On

The issue was within the JS resource. Something was conflicting with the post action and caused the field to be null. I have resolved the issue and I am now grabbing the value perfectly.