Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hey guys :)
I love the JS api its pure awesomeness. But is it just me but shouldnt this just work aswell ?
<form action="/tcbase/teacommerce/SubmitForm.aspx" name="sub" method="post"> <input name="addUniqueOrderLine" type="hidden" value="nodeId,orderLineId,quantity"> <input name="nodeId" type="hidden" value="@orderline.NodeId"> <input name="orderLineId" type="hidden" value="@orderline.Id" /> <input name="quantity" type="hidden" value="-1"> <button type="submit" class="subtract" value="+"> x</button> </form>
Ive done the same thing with a removeorderline and that just worked, but this just dosnt work.(ofc the right values are in the value fields.)
it works if i call it with JS like
TeaCommerce.addUniqueOrderLine(1168,114,-1);
Hi Rasmus,
Thanks for the kind words of awesomeness. :)
Yes, that should work. Maybe because your button is "button" and not submit?
Or maybe because the AddUniqueOrderLine name must be with capital first letter.
/Rune
Awesome it worked.
it was the capitol letter. I thought i was supposed to "call" it just as the JS functions (my bad)
Yeah. That would be our best practice naming. Small first letters in JavaScript. Capital letters in C#.
Good thing you got it running. JavaScript fallback is always a good idea. Although people with no JavaScript must be used to weird website behavior.
Yea non js people must have a shitty experience :) but fallbacks are nice, and with JQ we can just throw in a quick post serialize form or something like that.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Can we use a non JS approch on submits
Hey guys :)
I love the JS api its pure awesomeness. But is it just me but shouldnt this just work aswell ?
Ive done the same thing with a removeorderline and that just worked, but this just dosnt work.(ofc the right values are in the value fields.)
it works if i call it with JS like
TeaCommerce.addUniqueOrderLine(1168,114,-1);
Hi Rasmus,
Thanks for the kind words of awesomeness. :)
Yes, that should work. Maybe because your button is "button" and not submit?
Or maybe because the AddUniqueOrderLine name must be with capital first letter.
/Rune
Awesome it worked.
it was the capitol letter. I thought i was supposed to "call" it just as the JS functions (my bad)
Yeah. That would be our best practice naming. Small first letters in JavaScript. Capital letters in C#.
Good thing you got it running. JavaScript fallback is always a good idea. Although people with no JavaScript must be used to weird website behavior.
/Rune
Yea non js people must have a shitty experience :) but fallbacks are nice, and with JQ we can just throw in a quick post serialize form or something like that.
is working on a reply...