- This topic has 12 replies, 2 voices, and was last updated 12 years, 4 months ago by luckay.
-
AuthorPosts
-
luckayMemberDear All,
I am new to MobiOne, I am trying to show an alert with the value of textField1.. but it does not work
could any body please help?I set the Actions property of push1 to PopupAlert and then
$(‘#textField1’).text()I also had tried to use run javascript below.. but still no luck 🙁
function alertText(){
var myTextField = document.getElementById(‘textField1’);
if(myTextField.value != “”)
alert(“You entered: ” + myTextField.value)
else
alert(“Would you please enter some text?”)
}any help would be appreciated..
thanks a lot in advance
Regards
WinAttachments:
You must be logged in to view attached files.
KaleMemberHi,
try this code:
function displayAlertWindow(){ var myValue = $('#m1-YourAppName-textField1').val(); if(myValue!=""){ alert('Your text is:' + myValue); }else{ alert('Please enter text!'); } }
Greetings Kale
luckayMemberThanks, I tried it .. but it does not show anything 🙁
any idea?
KaleMemberWorks perfectly on my side. I have created a textfield and a button and saved the project as ‘YourAppName’. The button calls the function displayAlertWindow()
Make sure that the function is called correctly and change the name of the textfield in the code.
$(‘#m1-YourAppName-textField1′)
Greetings Kale
luckayMemberyes, I am sure..
my application name is test1.mobi .. so it would be $(‘#m1-test1-textField1’)
any comment? or did I miss something?
luckayMemberyes, I am sure..
my application name is test1.mobi as enclosed . so it would be $(‘#m1-test1-textField1’) ..
any comment? or did I miss something?
Attachments:
You must be logged in to view attached files.
KaleMemberHmm, don´t know why, but I can´t post code here anymore. Getting an error that I don´t have permission.
“Forbidden
You don’t have permission to access /support-genuitec/posting.php on this server.”
KaleMemberUse the attached file and insert the function code in test1_custom.js at the end.
I removed the code from the Run Java Script Code Window and left only the function call.
You have to insert the whole code (beginning with function) from your original Run Java Script Window in test1_custom.js.
If I could post code it would be easier for me to show you.
Greetings Kale
Attachments:
You must be logged in to view attached files.
luckayMemberHi..
I copied the function into test1_custom.js at the end as enclosed and set the onclick event to displayAlertWindow()but it does not triggered … any idea? ..
please helpThanks & Regards
Attachments:
You must be logged in to view attached files.
KaleMemberI attached a zip file with a working version. Just extract it and open the project, it works fine on my side. Please let me know the differences between your version and the version I attached, because I really don´t know what could cause the problem on your side.
Greetings Kale
Attachments:
You must be logged in to view attached files.
luckayMemberHi,
Yours is working properly.. I am still checking what the different between yours and mine (not working) .. strange .. I also enclosed it for your review ..
Attachments:
You must be logged in to view attached files.
KaleMemberAt the very end of your code there is a “?”.
Delete it and everything works properly. 😉
Greetings Kale
luckayMemberHi Kale,
Thanks for your help 🙂 .. I am very new with this, so this is very helpful for me and as a kick-off playing with MobiOne..
Again.. Thanks a lot .. and have a nice day 🙂Regards
Winanjaya -
AuthorPosts