Automatic <sp> and <br>

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Juliensohn
Posts: 6
Joined: Sat Sep 27, 2014 5:07 am

Automatic <sp> and <br>

Post by Juliensohn » Sun Sep 28, 2014 7:51 am

Hello, I want to type in a text in prompt and save it in a variable

like:

var answer=prompt("Type your answer in here:","Answer text")

but the user has to type answer<sp>text, otherwise there will be an error.. Is it possible to just type answer text and imacros automatically do the <sp>?

I hope u know what i mean, my english isn't the best, sorry!
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

Re: Automatic <sp> and <br>

Post by skippyto » Mon Sep 29, 2014 9:56 am

Hi

Code: Select all

answer = answer.replace(/\ /g, "<SP>"); 
See http://www.w3schools.com/jsref/jsref_replace.asp for better understanding.

Skippyto.
Post Reply