facebook

Help with javascript code

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 15 posts - 1 through 15 (of 38 total)
  • Author
    Posts
  • #348356 Reply

    Henzalah
    Member

    hallo everybody,

    i am facing a problem with text field (on change javascript) for example i have 53 apartment i have created all the apartments as .mobi files (apartment1.mobi) and for example if i want to enter apartment 5 i will type
    5 in the text field and it will directs to apartment5

    i have been working in this for 2 days but i didnt manage to get a result.

    i hope that someone might help me in this

    thanks in advance.

    #348357

    Henzalah
    Member

    pleaseeeeeeee any reply

    #348359

    Hi Henzalah,

    I have marked as duplicated your other threads since it is not necessary open many of them to get help. Please note that we try cover as many support cases as possible for day and we don’t just start with the first one that enter in the queue, we have to give priority to yes/no questions and bugs or possible bugs related with mobione.

    Back to your question, can you share what you have tried so far? You might be missing a little thing and we can help to spot it, it’d be better to fix something almost finished than providing a completely different approach that you might not be familiar with.

    #348362

    Henzalah
    Member

    thanks alot for ur reply

    i attached my file and sry for writting in more than one place.
    thanks alot for ur support

    Attachments:
    You must be logged in to view attached files.
    #348365

    Henzalah
    Member

    also i tried more than on way but i never get a result writting the JS code directly or in the cosy_custom.js drives me to the same dead end
    all i want is when i type a number inside the text field it directs me to apartment.mobi for example ( i have created 53 apartment and i named them as (apartment1.mobi and so on).

    i hope that i am clear enough.

    Attachments:
    You must be logged in to view attached files.
    #348370

    Code_A
    Member

    Give something like this a try:

    var aptNum = $('#m1-<screen>-<textfield>').val();
    var aptScreen = 'm1-apartment' + aptNum;
    phoneui.gotoScreen(aptScreen);
    #348371

    Henzalah
    Member

    code A

    i will try it now thx alot i believe that i should also write the destination folder for the apartments.mobi

    right ??

    #348372

    Henzalah
    Member

    it didnt work ……

    Attachments:
    You must be logged in to view attached files.
    #348373

    Code_A
    Member

    In your case (from what I can tell).

    <screen> = cosy
    <textfield> = textField1

    You may need add your other mobi files to the misc files section of your project. I normally use the multipage widget instead of multiple screens. My above code is untested but I think it should be on the right track.

    #348376

    Henzalah
    Member

    i modified everything as u mentioned but still i didnt get any result…
    i will explain to you what i need exactly
    i have 53 appartment each one is apartment1.mobi, apartment2.mobi and so on.
    i would love to attach all these apartments with numbers so that when i put 3 in the search field it takes me to apartment 3
    and i tried alot of codes and JS
    maybe if u can explain to me what i can wirte inside code and what i can write inside cosy_custom.js i can manage to find the solution because there is 2 places where i can modify in.

    appreciate ur help.

    #348382

    Code_A
    Member

    I just tested the code and works fine. Make sure you add the additional mobi files to your project (see example below).

    var aptNum = $('#m1-cosy-textField1').val();
    phoneui.gotoScreen('m1-apartment' + aptNum);
    Attachments:
    You must be logged in to view attached files.
    #348393

    Henzalah
    Member

    hallo again

    i tested the new code that u send to me but still not working for me i inserted one .mobi file to test it but it didnt work .
    can u please check it incase there is something i did wrong

    Attachments:
    You must be logged in to view attached files.
    #348394

    Code_A
    Member

    Maybe it is case sensitive. Did you try using Apartment instead of apartment? If that doesn’t work then post your project.

    #348397

    Henzalah
    Member

    ohhhh Finaly it is working thanks alot

    now i already created a Login UI which i want to conect each User ID and Password to an apartment is this possible or there is any restriction ?

    Thanks alot again

    #348399

    Code_A
    Member

    Yes, it is possible but how you do it depends on how you are storing your data. Are you storing the user data locally or on web server? For example, is the data in localStorage, in a file, in a DB? Please explain.

Viewing 15 posts - 1 through 15 (of 38 total)
Reply To: Help with javascript code

You must be logged in to post in the forum log in