E-mail textfield helper - remove everything that follows after "@"


#1

Hi, I have small buttons that help users to fill an email textfield

mail

Let’s say a user typed john@goo and he notices the “shortcut”…and wants to use it but he already typed too much.

How can I remove the @ and everything behind it?

Thx!!


#2

Hi!

You can do this using Axure’s string functions, which are just like their javascript counterparts. I’ve attached a file below.

If you’ve not used expressions before, I would take a look at this page from the Axure folks. Also, you’ll want to use a local variable for this, so read this post if you’ve not used them before.

Also, if you’re new to conditional logic (if and else if), read this page.

To understand how the substring() and indexOf() functions work, google “javascript substring” and “javascript string indexOf.”

file: password_shortcuts.rp (49.6 KB)


#3

Thank you so much for your fast reply. Actually I was scrolling through some axure functions and looked up indexOf on https://www.w3schools.com/jsref/jsref_indexof.asp , but the example returned just a number - that confused me. I didn’t know about substring as well. Cheers


closed #4

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