Hide submit button on client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2019 01:02 AM
Hi.
How can i hide the submit button with a client script?
I use: this,jQuery('button').hide();
But it hides all buttons and it is a problem in my form, i need hide only submit button
Thanks and greetings
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2019 12:54 AM
Hi,
All buttons are hiding with this,jQuery('button').hide();
because you are using button instead for id of that button so it is applicable for all buttons present there.
Try this,jQuery('#button_id').hide();
Mark Correct if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2022 10:15 AM
To just hide the submit button, you can try the below in an onLoad catalog client script,
//Get all buttons on form
var buttonQuery = this.jQuery('button');
for (var i in buttonQuery){
//For each of the buttons, check if the button name is 'submit'
if (buttonQuery[i]['name'] == 'submit'){
//Set display to none to hide
buttonQuery[i].style.display = 'none';
}
}