Highlighted

Help - Strings and User Input

Avatar

Guest

21-05-2008

We are attempting to create a form that will mimic macros from word perfect. Is it possible to create a function that will prompt a user for input via a popup or alert box and then place the results into a string and display said string to a text box?



I have been able to display text to a textbox's rawvalue and to combine variables into a string, but have not be able to get the prompt feature to work.



Any help would be greatly appreciated.



Thank you



Paul Washburn

Replies

Highlighted

Avatar

Guest

21-05-2008

update - i was able to prompt the user using app.response feature described in a previous thread.



Could you please tell me if it is possible to create a dynamic string as the user types to that when a function is activated it will add text to an existing text field instead of overwriting whatever is currently in that field.



Thank you
Highlighted

Avatar

Guest

21-05-2008

Paul,

You can set up the dynamic field to have a calculate event that would have the following javascript code:



This.rawValue = This.rawValue + additionalField1.rawValue;



This will append the value of whatever is being entered in the additionalField to whatever is already in your dynamic string field.
Highlighted

Avatar

Guest

28-05-2008

Thank you for your suggestion



I created a variable and assigned the fields current value to that variable, then added to the variable to the output. I threw in an if variable == null statement to fix the variable printing null.



ie.



var CurrentValue

if (TextField1.rawValue == null)

CurrentValue = "";

else

CurrentValue = Textfield1.rawValue;
Highlighted

pguerett

28-05-2008

A better technique would be to use an app.response (like a javascript response) where you can control what the user sees then getting that result and appending it to the desired field.



It would look something like this:



var myVar = app.response("Enter in some text: ", "This is the Title of the box.", "Default answer", false, "This is the label");

this.rawValue = this.rawValue + myVar



The true/false value in th e2nd last parameter indicates whether you want **** to appear instead of what is typed (like a password).



Let me know if you find this better.