Guest User

Untitled

a guest
Aug 18th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. set certain form inputs to certain values using jquery
  2. $(document).ready(function() {
  3. $("#link-1").click(function() {
  4.  
  5. $('[name=price]','#myform').val('0.00');
  6. });
  7. });
  8.  
  9. $(document).ready(function() {
  10. $("#link-1").click(function(e) {
  11. $('#myform').find('input[name="price[]"]').val('0.00');
  12. e.preventDefault(); // use prevent default instead of inline js on the link.
  13. });
  14. });
  15.  
  16. $('#myform input[name="price[]"]').val('0.00');
  17.  
  18. $(function() {
  19. $("#link-1").click(function() {
  20. $("input[name^=price\[]", "#myform").val('0.00');
  21. return false;
  22. });
  23. });
Add Comment
Please, Sign In to add comment