Hi All,
I have the below query.
i have created a web form using html activity (not V5) , in the web form I am collecting some data in text form, now i want to store this value in context variuable.
For eg
Context variable created in web application with name : my_purchase_number
In the web form there is a input text field where user enters the purchase number stired in JS variable inside html, let's say variable name is purchase_number.
When user clicks on submit button i want the value of context variable ctx.vars.my_purchase_number = purchase number.
Any help on how to achieve this is highly appreciated.
Regards
Jay
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @jitendrak
You will have to create a javascript function to do this.
Here is an example
<script>
function updateCtxValues(){
var purchaseNumber=document.getElemebtById('purchase_number').value;
document.controller.setValue('/ctx/vars/my_purchase_number', purchaseNumber);
}
</script>
You will have to call this function on the form submission by onclick event
<input type="button" onclick="updateCtxValues()" value="submit">
Also, make sure your purchase number input has an id attribute of value "purchase_number"
Let me know if that works.
Thanks
Views
Replies
Total Likes
Hello @jitendrak
You will have to create a javascript function to do this.
Here is an example
<script>
function updateCtxValues(){
var purchaseNumber=document.getElemebtById('purchase_number').value;
document.controller.setValue('/ctx/vars/my_purchase_number', purchaseNumber);
}
</script>
You will have to call this function on the form submission by onclick event
<input type="button" onclick="updateCtxValues()" value="submit">
Also, make sure your purchase number input has an id attribute of value "purchase_number"
Let me know if that works.
Thanks
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies