For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 10 replies, 4 voices, and was last updated 14 years ago by
davidaflores.
-
AuthorPosts
-
WoodgelaMemberSorry for the n00b question but i’m having some difficulties linking pages together.
I want to create a link to another page that ive created based on specific selection criteria that i have chosen from the Select Menu List. I can’t seem to create a valid link. Everytime i try to use the push button in emulator mode nothing happens. Also i need the link to take into account multiple selections from Select menu lists.
Any help would be greatly appreciated.
Thanks.April 21, 2011 at 12:30 pm #316237
support-michaelKeymaster@Woodgela
If the UI page flow is conditional then I recommend creating your own javascript function and binding it to the Link property of your UI control that initiates the page transition. Later today I will provide snippet that demonstrates accessing SelectListMenu value access and page transition.July 22, 2012 at 1:59 am #328384
davidafloresMember@support-wayne wrote:
@Woodgela
If the UI page flow is conditional then I recommend creating your own javascript function and binding it to the Link property of your UI control that initiates the page transition. Later today I will provide snippet that demonstrates accessing SelectListMenu value access and page transition.Hi. Can you post the snippet here with screenshots and code. I too have been trying to do this but haven’t been successful at all. Thanks.
July 23, 2012 at 3:38 pm #328408
support-octavioMemberHi David,
Please take a look at this Wayne’s example and let me know if is helpful for you.
http://www.genuitec.com/support-genuitec/viewtopic.php?p=6351#p6351
July 24, 2012 at 2:49 pm #328440
davidafloresMemberHi Octavio,
It was a little. What I was trying to do and it is really getting to me is a simple conditional branching where if you have two combo boxes and 1 button – and say if the pick one thing from a combo box 1 and something else from combo box 2, when you hit the custom button, it would take you to one page, if you had a different combination, it would take you to another.
My understanding and I may be wrong is that I need to set the variables in each combo boxes. They need to be recalled and then the function executed in the actions of the button.
I’ve tried to simplify as well to see if I am doing this correctly and choose 1 dropbox and 1 botton. Under the dropdown box code, I wrote the following:
<div id=”form1-combobox1″ class=”select-list-menu-spinner iscroll-no-prevent-default combobox”
name=”combobox1″ data-hiddenInputId=”form1-hidden-select-combobox1″
data-selectionInfoId=”form1-combobox1″ data-multiple=”false”>
</div>
<div class=”aux-hidden-div”>
<select id=”form1-hidden-select-combobox1″ name=”combobox1″>
<option value=”value1″ label=”Item 1″ selected>Item 1</option>
<option value=”value2″ label=”Item 2″>Item 2</option>
<option value=”value3″ label=”Item 3″>Item 3</option>
<option value=”value4″ label=”Item 4″>Item 4</option>
<option value=”value5″ label=”Item 5″>Item 5</option>
</select>
</div>Under the botton, I wrote:
function e1 (){
if $(‘select[name=”combobox1″]’).val(“value2″)
{phoneui.gotoPage(‘m1-t2’,phoneui,transitions.FLIP_LEFT)
}
else $(‘select[name=”combobox1”]’).val(“value3”)
{phoneui.gotoPage(‘m1-t3’,phoneui,transitions.FLIP_LEFT)
}I don’t know if I have a syntax error or simply am missing something.
Thanks,
David
July 24, 2012 at 6:57 pm #328446
support-octavioMemberHi David,
I think you’re not ussing the the link hack trick: http://www.genuitec.com/support-genuitec/viewtopic.php?p=4543#p4543
Let me know if it was the issue.
July 26, 2012 at 9:00 pm #328517
davidafloresMemberHi Octavio,
I think I might be asking for the wrong thing. I need an example of how to use the conditional statements if .. else, else if to control either to go to a different .mobi page or an alert message. For example, I used an the following example code to create a simple pop window with the number entered:
function openLink()
{
var myAge = $(‘#m1-test-myAge’).val();
if(myAge!=””){
alert(‘Your age is:’ + myAge);
}else{
alert(‘Please enter age!’);
}
}The problem is the following. I wanted a different message to display based on age entered:
function openLink()
{
var myAge = $(‘#m1-test-myAge’).val();
if(myAge!=>45){
alert(‘You qualify for study’);
}else{
alert(‘Sorry’);
}
}I can’t get this script to work. Eventually, I wanted to do a two variable condition but I can’t even get 1 variable to work. Please help. I don’t know if it’s a syntax error etc. If you could give me an example of a two variable condition script, that would be great too.
Thanks,
David
July 27, 2012 at 11:43 am #328533
support-octavioMemberHi David,
You’re using “!=>” as an relational operator, that is invalid. Please try with “<=” to compare if the first statement is equal or less than the other statement value or “>=” in opposite case. Hope this is helpful for you.
July 27, 2012 at 3:42 pm #328538
davidafloresMemberThank you thank you thank you. That did it. You don’t know how much of a headache that was trying to figure out why it wasn’t working.
July 27, 2012 at 4:53 pm #328539
davidafloresMemberHi Octavio,
Thank you again for fixing my syntax. One last question – what am I doing wrong with this syntax:
function openLink()
{
var myAge = $(‘#m1-test-myAge’).val();
var myAge2 = $(‘#m1-test-myAge2’).val();
if(myAge>=”4″ && myAge<=”8″ && myAge2>=”5″){
alert(‘You qualify for study’);
}else{
alert(‘Sorry’);
}
}Never mind – found the syntax error.
Thanks,
David
July 29, 2012 at 9:34 pm #328558
davidafloresMemberNew question.
So I’ve gotten good at the selection criteria. However, I just noticed that it loops when you have more than 4 variables and/or when you are using conditional selections on multiple pages. Do you know if that is a problem with mobione or is it my syntax again. Here is an example of the syntax that will not work:
function question3()
{
var myGfr=&(‘#m1-page3-myGfr’).val();
var myBmi=&(‘#m1-page3-myBmi’).val();
var myHgb=&(‘#m1-page3-myHgb’).val();
var mySbp=&(‘#m1-page3-mySbp’).val();
var myDbp=&(‘#m1-page3-myDbp’).val();
var myUacr=&(‘#m1-page3-myUacr’).val();
var myFerritin=&(‘#m1-page3-myFerritin’).val();
var myHba1c=&(‘#m1-page3-myHba1c’).val();
var myK=&(‘#m1-page3-myK’).val();if(myGfr>=”25″ && myGfr<=”59″ && myBmi=” ” && myHgb=” ” && mySbp<=”150″ && myDbp<=”100″ && myUacr>=”300″ && myUacr<=”10000″ && myFerritin=” ” && myHba1c<=”9″ && myK=” “)
{
alert(‘Congratulations’);
phoneui.gotoPage(‘#m1-page4’,phoneui.transitions.slideLeft);
}else{
phoneui.gotoPage(‘#m1-pageend’,phoneui.transitions.slideLeft);}
}
}Similar code – you can even say cut an past on previous page but with only two variables works beautifully. The one here doesn’t.
On a side note – I really like your product.
Thanks,
David
-
AuthorPosts
