Home > Forum > Rules, JS, SQL > [SOLVED] Q: How can values be written back to a form field from JavaScript (within an HTML element)?

[SOLVED] Q: How can values be written back to a form field from JavaScript (within an HTML element)?
0

MVP

Hello everyone,

we are using JavaScript for a RestAPI call (long story – it's a requirement from IT). Now I receive the "Response Status Code" and "Response Text" within the JavaScript, but I also need to send these values back to WEBCON for further processing.
Since we usually work with WEBCON without using JavaScript, I’m lacking the necessary know-how in this area.

Can anyone assist me with this?
Thank you in advance!

Wishing you all a great weekend,
Bjoern

MVP
In reply to: Jacek Wojnar

Hi,

you can use SetValue function (screenshot) in form rule (javascript mode)

Hi Jacek,

Perfect—thank you for the quick response! With your help, I can now complete the application before the weekend.

I hadn't considered looking for a JavaScript functions menu, so this was really helpful.

Wishing you a great weekend ahead!

Best regards,
Björn

P.S.: For anyone else with the same question, I’ve adapted Jacek’s solution specifically to my fields and attached it as a reference.

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings