Order Now or Submit Button

alexcharleswort
Tera Expert

I know this question has been asked a lot on here, and I have used a bunch of suggestions already, without success. I have had several complaints about the cart feature and was trying to add a "submit" button on the bottom of the form. I can make these buttons all day long, but I cannot seem to get them to link. I assume this is supposed to be a ui action?? so, from start to finish, does anyone have any great ideas on how to make this possible? Also, I have already weighed my option of going with record producer instead of service catalog, but I decided against it.

1 ACCEPTED SOLUTION

I have limited scripting knowledge as well so I could be wrong but I think ours is just a UI macro then the macro added to the catalog item form. The button was created during our original portal implementation with assistance from Fruition.



Below is the UI macro code we use...


<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


<div class="orderButton">


<a class="request_catalog_button addtlBtn" onClick="orderNow();">Order Now</a>


</div>


</j:jelly>



Then we added the variable to the form...


Type: Macro


Name: order_now


Macro:   "name of UI macro above"



Button as it appears on the portal...


find_real_file.png



Our ESS users are able to click this button and submit their REQs with no issues.



Sarah


View solution in original post

16 REPLIES 16

Glad I could help!


Hi sarah.powell@hancockbank.comsarah.powell@hancockbank.com



This is not working anymore. I have tried using this before and it works but unfortunately now, it does not. Error displays:



Cannot set property 'onclick' of null.



Can someone help?



Thanks!


We are still using the code above with no issues. Have you recenly upgraded your instance?


It's actually not working anymore for us either. I don't know if all these Fuji hotfixes messed with it or not.


harryadjevi
Kilo Contributor

Hi all,



I'm on Fuji and did Sarah's suggestion, all working fine.


I also changed the script so the button displays as blue like the top one


To do that I used Chrome, right click on the top "Order Now" button => Inspect Element


then copied the code into the "order_now" macro, as below



  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
  3. <td style="min-width: 200px; max-width: 200px;" class="order_buttons" colspan="2">
  4. <button id="order_now" title="" class="request_catalog_button_with_icon btn cat-btn btn-primary" onclick="if ($$('.order_buttons .disabled_order_button').length == 0) { orderNow(); } else { alert('Please wait - price being updated'); };" type="button" href="#" data-original-title="Order Now">Order Now</button>                        
  5. </td>
  6. </j:jelly>


I just copied the whole code.


Button now appears as this:


find_real_file.png


Now I need to find a way to remove the grey border around it or set it white.


Its really helping out to use the "Inspect Element" from Chrome function, give it a try.



Thanks.



Harry