Does Axure 8 support the javascript function .startsWith()


#1

Hi

I am trying to use the javasript .startsWith() in axure but it is not working and I am not sure what I am doing wrong.

I am trying to check whether the text in my text field (txt_Name) starts with a particular phrase. I triggered this check when I click on a button. I also created two global variables test and test2

My OnClick Case contains the following:
Set value of test equal to text on txt_Name
Set value of test2 equal to [[[[test]].startsWith(‘fon’,0)]]
Set text on This equal to test2.

When I click on the button, the following gets displayed fon.startsWith(fon,0).

However, I was expecting true to be returned. How do get this to work?


#2

No, startsWith() isn’t supported in Axure. Here are the variables and functions supported (this list not changed from V7 to V8 to my knowledge)

You could try using .lastIndexOf() as outlined in this stackoverflow post:
https://stackoverflow.com/questions/646628/how-to-check-if-a-string-startswith-another-string


closed #3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.