java Script ot remove html elements
Posted: Wed Nov 18, 2020 2:47 pm
I'm currently developing a new admin/categories tab, but I'm wanting to remove the following <div>'s from the core categories file and place them in the new tab. My new tab works well by editing the categories.php to manually remove the unwanted <div> elements.
<div class="form-group row">
<label for="pTax" class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'id="pTax" onchange="updateGross()"');
?>
</div>
</div>
<div class="form-group row">
<label for="pNet" class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('products_price', $pInfo->products_price, 'required aria-required="true" id="pNet" class="form-control w-25" onchange="updateGross()"');
?>
</div>
</div>
<div class="form-group row">
<label for="pGross" class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('products_price_gross', $pInfo->products_price, 'id="pGross" class="form-control w-25" onchange="updateNet()"');
?>
</div>
</div>
My question is, which I'm sure is possible, how does one use java script to remove the elements and which hook to place the script in.
Any advice will be appreciated.
Mike
<div class="form-group row">
<label for="pTax" class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'id="pTax" onchange="updateGross()"');
?>
</div>
</div>
<div class="form-group row">
<label for="pNet" class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('products_price', $pInfo->products_price, 'required aria-required="true" id="pNet" class="form-control w-25" onchange="updateGross()"');
?>
</div>
</div>
<div class="form-group row">
<label for="pGross" class="col-form-label col-sm-3 text-left text-sm-right"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('products_price_gross', $pInfo->products_price, 'id="pGross" class="form-control w-25" onchange="updateNet()"');
?>
</div>
</div>
My question is, which I'm sure is possible, how does one use java script to remove the elements and which hook to place the script in.
Any advice will be appreciated.
Mike