So I would take of on your html form the onsubmit()=…, once isnt needed and your javascript function should only have something like this.
document.getElementById("form_1").style.display = "none";
or
document.getElementById("form_1").style.visibility = "hidden";
this should do the job, if for some reason it does not, change the onclick from the input to the form tag.
Your code should look like so:
<form onclick="myClick()" id="form_1" name="form_order_id" action="#" method="post" >
<input type="hidden" name="frub_id" value="<?= $order->get_id() ?>" />
<input type="submit" name="<?= $order->get_id() ?>" value="<?= $order->get_id() . $edit_form1 ?>" />
</form>
<script type="text/javascript">
function myClick(){
document.getElementById("form_1").style.display = "none";
}
</script>
Related Posts:
- Use wc_enqueue_js only on specific pages – nested add_action
- woocommerce subscriptions – get expiration date [closed]
- How to create a form and display its content as table in admin panel?
- Automated Cart Update With Alert Box Each Time
- Modify HTML structure of fields in woocommerce checkout form
- How to auto fetch customer details in Woocommerce in checkout page
- Sum the total amount of a specific product purchased per user and display in table
- I want to add custom add to cart link [closed]
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- Change product_base programmatically
- WordPress shortcode returns the data before
- Can a plugin redirect product page based on IF condition?
- Using admin-post.php for admin form but it directs me to admin-post.php white screen
- WordPress WP_Query without query GET parameters
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- custom post type with role Vendor
- Adding Additional Variables on Menus Page
- Woocommerce custom Plugin in wordpress [closed]
- Add a custom WooCommerce settings tab with sections
- Payment field disappears on custom Paypal plugin
- I am having errors with checkout on wordpress
- product_type_options get saved value [closed]
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Looping through and combining calls to Woocommerce REST API
- Store user form submitted information in post type
- How to import woocommerce custom fields data into another site?
- How do I remove an action hook inside a class that is called by another class?
- not able to access $_POST on backend profile update
- Custom Plugin Develoment, Form Action
- Using Nonce for my Form
- Trouble using wordpress functions in a pop-up modal form
- How keep woocommerce users separeted in multisite install and keep admins on network
- Custom field fetch error on woocommerce pdf invoice
- Woocommerce Convert existing order to the cart
- How to change product SKU’s in bulk with a plugin
- Woocommerce Payment Method Change
- Validate a custom form with js and php
- How to add a second ‘place order’ button in WooCommerce [closed]
- Using Multiple Submit buttons to trigger customised php functions
- Instantiate class to be available to all plugin functions
- Common abstract class for plugins
- How to trigger $_GET request within admin plugin page?
- Get Admin Email Address From External PHP page
- Adding Custom Forms
- How do I let users upload files to a chosen location?
- How to test nonce with AJAX – Plugin development
- What does $wpdb->get_row return?
- woocommerce registration form with klaviyo(don’t work with current user)
- Change the URL of an image from wp_get_attachment_image_src except in the frontpage
- How do I display a user’s previous orders as a select box option on a product?
- How do you add customer capability after Woocommerce purchase?
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Change sign up fee in cart for subscription products WooCommerce
- How can I use wp_query to show all product data using just the products ID?
- WP add_action factory
- wp_loaded hook block script enquequing
- write custom woocommerce templates and forms
- combine Code 1 with Code 2
- WooCommerce – Reset quantity input field when variation changes
- WP nonce invalid
- get current product name in functions.php
- Get stock by custom meta field on all Woocommerce variable products
- Make the first item as default on Woocommerce product category items list
- Custom Text in WooCommerce Order Processing Email Based on Products
- Woocommerce redirect thankyou page based on product ID doesn’t empty Cart
- Set a condition based on WooCommerce checkout city field while placing order
- WooCommerce registration password field not displaying
- Get WooCommerce product details and transfer them to a custom DB table
- Custom form action to handle data inside a plugin
- Same log message keeps on printing to debug.log file thousand of times
- tracking number field in Woocommerce order [closed]
- WooCommerce Related Products by Attribute
- Adding Default Settings to Theme My Login plugin
- Image as Sales Badge
- Custom filter in admin edit custom post type responding with invalid post type?
- WordPress Scheduled Event Request Blocking
- How can i upload images in an admin page?
- Append HTML Using Shortcode
- Delete a WordPress transient from a shortcode on Page/Post update
- WooCommerce – Email admin with new user details
- Plugin CSS not enqueing
- Create onClick Event to Re-load a Widget
- Swapping wp_dropdown_categories function with wp_category_checklist
- Automatically remove a canceled order in Woocommerce
- Accessing the database from a plugin outside of action hooks
- Adding subdomain to home_url for “add_menu_page”
- How to show phpinfo() only in a new tab?
- How to find error in my code when the error message is pointing to WP core file?
- How to select the contents in the text view textrea in wp_editor?
- Accessing data from a non-WP database/table within a page content
- Custom Form Processing Issue
- Call global variable array() in woocommerce child/template
- My form action url is being prepended with a directory that does not exists
- Remove price from Woocommerce variable product dropdown menu
- How to access global variable $menu inside a class function
- Adding nofollow to a PHP generated Nav
- Custom profile field with birthday. Troubles with
- How can I reuse the code to capture a param in a URL and place in a value in a hidden form?
- Hide categories that are not used in the post type
- How can I remove a function that has been added to wordpress with add_filter?