For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 6 replies, 3 voices, and was last updated 12 years, 2 months ago by
Code_A.
-
AuthorPosts
-
julianp4MemberHi
Can wanyone help on this one? I have a combobox with 6 different names in and I want each name to bring up a new set of numbers in a separate text box . How do I do this??
Waiting patiently with fingers crossed..
Also need to know if its possible to get the app to allow you to browse and insert an image from your photos….
Jules
December 31, 2013 at 9:05 am #345628
Code_AMemberSimilar question here with some code on how to set it up viewtopic.php?f=8&t=4937.
Hopefully this is enough to get you tarted. Post your code if you are having problems getting it to work.
December 31, 2013 at 10:45 am #345630
Unknown AuthorParticipantFirst link the combobox to the action “Run Javascript”.
Put some function name in there:
do_it();Then, in your pagename_custom.js file, you need the function:
function do_it(){ var n = $('select[name="combobox1"]').val(); $('#m1-pagename-text1').text(n); }January 1, 2014 at 6:28 am #345652
julianp4Member@1thinchip wrote:
First link the combobox to the action “Run Javascript”.
Put some function name in there:
do_it();Then, in your pagename_custom.js file, you need the function:
function do_it(){ var n = $('select[name="combobox1"]').val(); $('#m1-pagename-text1').text(n); }Thanks guys for your quick responses
Do I just then follow this with the IF and ELSE IF. Statements?
January 1, 2014 at 7:28 am #345653
julianp4MemberDo I use a standard text object in m1 or a text field object?
Thanks guys
January 1, 2014 at 7:42 am #345655
julianp4MemberSo kind of working but text is changing to “value2” and “value 3” and not “123.00” and “119.00”
here is my codefunction airfieldselect() {
var n = $(‘select[name=”combobox1″]’).val();
$(‘#m1-test-text1’).text(n);if (airfieldselect == ‘value2’){
$(‘#m1-test-123.0’);
}else if (airfieldselect == ‘value3’){
$(‘#m1-test-119.275’);
}}
January 1, 2014 at 8:54 am #345659
Code_AMemberedit by support-octavio: fixed and merged reply with attachment on this thread.
Accidentally posted this reply in the wrong thread! Meant to reply to this one viewtopic.php?f=19&t=6673.Here is a quick example of dynamically loading and selecting a combobox based on user selection from another combobox.
Below is the javascript code that is attached the combobox1 that controls combobox2. I have also attached the .mobi file.
//clear drop down $('#m1-FillCombobox-hidden-select-combobox2').empty(); //add new items based on selection if ($('#m1-FillCombobox-hidden-select-combobox1').val() == '0'){ $('#m1-FillCombobox-hidden-select-combobox2').append('<option value="2" label="2">2</option>'); $('#m1-FillCombobox-hidden-select-combobox2').append('<option value="4" label="4">4</option>'); $('#m1-FillCombobox-hidden-select-combobox2').append('<option value="6" label="6">6</option>'); }else{ $('#m1-FillCombobox-hidden-select-combobox2').append('<option value="1" label="1">1</option>'); $('#m1-FillCombobox-hidden-select-combobox2').append('<option value="3" label="3">3</option>'); $('#m1-FillCombobox-hidden-select-combobox2').append('<option value="5" label="5">5</option>'); } //update list display //$('select[name="combobox2"] option:first').attr('selected','selected'); $('select[name="combobox2"] option:last').attr('selected','selected'); $('#m1-FillCombobox-combobox2').text($('select[name="combobox2"] :selected').text()); phoneui.preprocessDOM('FillCombobox');Hope this helps.
Attachments:
You must be logged in to view attached files. -
AuthorPosts
