- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2020
11:24 PM
05-21-2020
11:24 PM
Magento 1.9 - How to declare two id or class name for single input field?
Magento 1 courier selection,
path : app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml
<span class="no-display"><input name="**bleep**() ?>" checked="checked" /></span> <?php else: ?> <input name="**bleep**()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/>
The input field i need to declare another name for my popup message purpose i just declare script for same file location,
app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml
<script> document.addEventListener('click', function (event) { if (event.target.name === 'obtrusive-radio') { alert(event.target.value) } }) </script>
I want to assign the name obtrusive-radio but input field already have a name like "shipping_method"
Labels:
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2020
01:03 AM
05-22-2020
01:03 AM
Re: Magento 1.9 - How to declare two id or class name for single input field?
Hello @Aveeva
You can do it based on element ID, instead of name:
document.getElementById("myBtn").addEventListener("click", function(){
document.getElementById("demo").innerHTML = "Hello World";
});
can't change name but you can have multiple classes to identify. Thanks
Manish Mittal
https://www.manishmittal.com/
https://www.manishmittal.com/