114
Views
6
Comments
Solved
How to show(read) textbox value in JavaScript alert in RWA

Hello All,

I am facing issue in one of the scenario, I have one textbox in reactive web application,  i wan to read to read/show that textbox value in JavaScript alert message.  

i have applied multiple JS code but giving error as see in the below snap.

can see in the below image..

1) textbox Input value

2) JavaScript Code

3) Error in the web page

If anyone knows how to fetch/read textbox value in JavaScript the kindly reply..

Thanks,


2026-02-26 06-29-24
Rahul
 
MVP
Solution

HI,

use this way,

take input parameter as widgetid in javascript  and pass id of textbox/input in this and get value like below


var username=document.getElementById($parameters.WidgetID).value;


alert(username);


Hope this will help you.

Regards

Rahul

2019-09-24 18-41-25
Jorge Martins
 
MVP

Hi JK2020,

What are you trying to achieve? If I wanted to show the value of an input to the user in some sort of message, I don't think I'd need to resort to JavaScript... just use the Message tool and pass it the variable that holds the value I want to display (in this case userName).

If you really need to do it using JavaScript and the alert() method:

  • Add an input parameter to your JS node, with the same data type as the userName screen variable and call it ValueToDisplay
  • in your JavaScript node you simply need to add: alert($parameters.ValueToDisplay);

Hope this helps!

UserImage.jpg
JK2020

Hello  Rahul Sahu  ,  Jorge Martins


Thanks For your replay it is working.




2026-02-26 06-29-24
Rahul
 
MVP

Cheers.

 

UserImage.jpg
JK2020

Hello All,

I have one Input. That Input is presented in the Grid of the Table.

Can anyone tell me how to get that Widget Input.Id .?

I have given the name of the each container Header and Row name but still not able to get that Widget's Input.Id..



I am using below JS code for testing but in that i  m trying to get that input value :-- "Input_OfferStartDate.Id"  as an input parameter.. Not able to get this Widget's Input.Id..

JS Code

var date = document.getElementById($parameters.InputStartDate).value;

alert(date );

Can anyone tell me how to achieve that..

2026-02-26 06-29-24
Rahul
 
MVP

Hi @JK2020 ,

this is very old thread you need to open a new one for the discussion. and its alreday marked as solution so People not understood you are asking new question .



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.