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

Password Input

Explorer ,
Apr 20, 2016 Apr 20, 2016

I actually have this but i dont know why my function is wrong when the text input have the correct pass  "hola" here is my code:

//AQUÍ EMPIEZA A CREARSE LA VENTANA DEL PANEL

{

    function myScript(thisObj){

        function myScript_buildUI(thisObj){

            var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette","Panel Estudio Voraz",undefined,{resizable:true},{borderless:false});

            myPanel.layout.resize();

           

            res = "group{orientation:'column',margins: 0, spacing: 0,\

                              grp3: Panel{type:'panel',text:'Patterns',orientation:'column',margins: [4,9,4,5], spacing: 1,\

                                                 alignChildren:['center','fill'],\

                                textInput: EditText{text:'',minimumSize:[150,10],properties:{noecho:true}},\

                            },\

                     grp4: Panel{type:'panel',text:'Patterns',orientation:'column',margins: [4,9,4,5], spacing: 1,\

                                                 alignChildren:['center','fill'],\

                                btn: Button{text:'Comprobar',minimumSize:[150,10],properties:{noecho:false}},\

                            },\

                     }";

                    

                     myPanel.grp = myPanel.add(res);

                    

var pass = myPanel.grp.grp3.textInput.text

myPanel.grp.grp4.btn.onClick = function (){

if(pass == 'hola'){

     alert("TRUE");

    }

else(pass != 'hola'){

    alert("FALSE");

    }

}

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    

                     //FUNCION QUE DETECTA TODOS LOS PROJECT ITEM Y EN LUGAR DE ASIGNARLE UN NÚMERO DEL INDEX LO DETECTA POR SU NOMBRE

function projectItem(name)

{

  var items = app.project.items;

  i = 1;

  while (i <= items.length) {

  if (items.name == name)

  {

  return app.project.item(i);

  break;

  }

  i++;

  }

}

TOPICS
Scripting
396
Translate
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

Contributor , Apr 20, 2016 Apr 20, 2016

I don't think you need the "(pass != 'hola')" after the "else" on 33. Not only is that incorrect JavaScript syntax, but your "if" condition already accounts for this. If you really want to keep it, I would write line 33 as "else if (pass != 'hola')"

Translate
Contributor ,
Apr 20, 2016 Apr 20, 2016

I don't think you need the "(pass != 'hola')" after the "else" on 33. Not only is that incorrect JavaScript syntax, but your "if" condition already accounts for this. If you really want to keep it, I would write line 33 as "else if (pass != 'hola')"

Translate
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
Explorer ,
Apr 20, 2016 Apr 20, 2016
LATEST

Thank you i actually got it.

Translate
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