• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to transmit the data?

New Here ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

In this script I create a window with an Edittext field and two buttons. The user can write something in Edittext field. How to read these data? I want to use it like a pattern in regular expressions.

I made an Edittext field a variable. How to transmit the data from it?

function SnpCreateDialog()
{
this.windowRef = null;
}


SnpCreateDialog.prototype.run = function()
{
// Create a window of type palette.
var win = new Window("palette", "Поиск",[100,100,400,250]);  // bounds = [left, top, right, bottom]
this.windowRef = win;

// Add a frame for the contents.
win.pnl = win.add("panel", [25,15,275,135], "Введите данные для поиска");

// Add the components, two buttons
    var txt = win.pnl.add("edittext", [15,25,230,45],"");
    //win.pnl.txt = win.pnl.add("edittext", [15,25,230,45],"");
win.pnl.okBtn = win.pnl.add("button", [15,75,105,95], "OK");
win.pnl.cancelBtn = win.pnl.add("button", [140, 75, 230, 95], "Cancel");

// Register event listeners that define the button behavior

var re = new RegExp(pattern);
   
    win.pnl.okBtn.onClick = function() {
  $.writeln("OK pressed");
  alert(re);
        //win.close();
};
win.pnl.cancelBtn.onClick = function() {
  $.writeln("Cancel pressed");
  win.close();
};

// Display the window
win.show();
 
return true;
   
//var re = new RegExp (txt);
//alert(re);
}

if(typeof(SnpCreateDialog_unitTest) == "undefined") {
    new SnpCreateDialog().run();
}

Views

522

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 02, 2013 May 02, 2013

Use:

win.pnl.txt = win.pnl.add("edittext", [15,25,230,45],"");

And then in the OK BTN function:

var value = this.parent.txt.text;

Greet,

Willam

Votes

Translate

Translate
Community Expert ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

Charlotte

This isn't the place to ask that question, unless you are very lucky. Most of the folks in this forum are technical authors whose job is to document how software works for end users or to create knowledge bases. Relatively few will use regular expressions in any way and even fewer will write scripts. Some will but very few and even fewer are active supporters of the forum.

I think you will do much better Googling "regex forums" and trying somewhere like http://regexadvice.com/forums/

Good luck with your diploma project.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

Use:

win.pnl.txt = win.pnl.add("edittext", [15,25,230,45],"");

And then in the OK BTN function:

var value = this.parent.txt.text;

Greet,

Willam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

@Willam - LOL - I was just about to reply to the OP and tell her that "you need to have a chat with Willam"!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

Sometimes I can read minds.

Greet,

Willam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 03, 2013 May 03, 2013

Copy link to clipboard

Copied

LATEST

Thank you very much!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp