Skip to main content
Nintex Community Menu Bar
Solved

Return Client-side Value (JavaScript) To Server-side (SmartForms)

  • September 5, 2018
  • 2 replies
  • 16 views
  • Translate

So i have a JS via datalabel: 

var offset = new Date().getTimezoneOffset();

 

Then i write it into my textbox:

document.getElementById('000000*personal details removed*0000_59e39e2b-5feb-87d4-ab3e-525f96384c6f').innerHTML=offsetname;

 

I can see the value successfully in the textbox.

 

Then i created a rule like - if textbox is changed show me message. But i never see the message. It works only if i change textbox value manually.

 

So the question is - how can i transfer a string variable generated on client-side into server-side?

Best answer by Albarghouthy

Hi,


 


For Text Box control:


 


$("[name='Text Box']").SFCTextBox('option', 'text',offsetname);

For Data Label:


 


$("[name='Data Label']").SFCLabel('option', 'text', offsetname);

HTH


 

View original

Albarghouthy
Forum|alt.badge.img+16

Hi,


 


For Text Box control:


 


$("[name='Text Box']").SFCTextBox('option', 'text',offsetname);

For Data Label:


 


$("[name='Data Label']").SFCLabel('option', 'text', offsetname);

HTH


 

Translate

  • September 6, 2018

Thank you! It works!

 

<script>
var offset = new Date().getTimezoneOffset();
var offsetname = Intl.DateTimeFormat().resolvedOptions().timeZone;
$("[name='Text Box 5']").SFCTextBox('option', 'text',offset+' '+offsetname);
</script>

 

Then make rule for textbox changing and use its value.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings