I hava a input
I want to get this value,but i not do it
So,I use the javascript for this
"
var inputElement = document.getElementsByName('Input_Company7');
if(inputElement.length > 0)
{ var a = inputElement[0];
window.alert(a);}
else{
window.alert("length="+inputElement.length)}
It alerts "leagth=0"
How i can do to get value?
Help me,thanks!
Hi Hora,
The platform automatically assigns generated ids for every OutSystems widget that has its Name property assigned.
You can get the Id automatically generated by OutSystems at runtime and inject it in your JavaScript code, as input parameter.
So add to your Javascript node, an input parameter called WidgetId and set its value in your action to Input_Textvar3.Id.
Regards,
Daniel
ps. to validate the length of the Input widget, you don't even need to use JavaScript. As you have set the mandatory attribute on the input widget, the widget state will be invalid if it isn't filled. The Input_TextVar3.Valid property will be false.
For more info see:https://success.outsystems.com/documentation/10/developing_an_application/design_ui/forms/validate_form_inputs/
Thank you very much! I get it!
Hi @Hora susuki ,
As correctly mentioned by Daniel, you can directly pass the automatically generated Id for the input widget as an input to your javascript . This will give you the value. Hope this helps!.
You help me .Thank you very much
If you think this solution helped and working fine, you can mark it as Solved.