Page 2 of 4

Access dynamic created Input Control that is selected by a user.

Posted: Mon Sep 09, 2013 5:00 pm
by Pete Nellmapius

I did show alert and commented that out but it made no difference.


Access dynamic created Input Control that is selected by a user.

Posted: Mon Sep 09, 2013 5:01 pm
by Pete Nellmapius

// alert("Value must be between 0 and 5")
$(this).val(null);
$(this).get(0).focus();

That's my code the value gets set to null but the focus does not do anything.
Wierd


Access dynamic created Input Control that is selected by a user.

Posted: Mon Sep 09, 2013 5:19 pm
by Anton Artyukh5836028

$(this).val(null); is wrong way to clear input. Use $(this).val( "" ); for this.

I create simple app, added two inputs. For first input I create Value change event action with code: prevar inputValue = $(this).val();
inputValue = parseInt(inputValue);

if (Math.floor(inputValue) == inputValue) {
if (inputValue < 0 || inputValue > 5) {
alert("Value must be between 0 and 5")
$(this)&#46;val("");
$(this)&#46;get(0)&#46;focus();
};
} /pre
And that works for me -- I can't move focus to second field if I enter something different than 0..5.


Access dynamic created Input Control that is selected by a user.

Posted: Mon Sep 09, 2013 5:36 pm
by Pete Nellmapius

I set the val to an empty string rather than null.
Same thing happens.
The only difference is that my Input controls are connected to a grid that's connected to a datasource and gets created dynamically.(I explained that at the beginning of this thread.
Thanks for the help.
If I get it to work I'll let you know.


Access dynamic created Input Control that is selected by a user.

Posted: Mon Sep 09, 2013 5:43 pm
by Anton Artyukh5836028

Code must work. Do you have errors in console?

Can you give me a public link to your app? Or you can share it with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a.


Access dynamic created Input Control that is selected by a user.

Posted: Mon Sep 09, 2013 6:17 pm
by Pete Nellmapius

.I'm not the owner of the app. My colleague is.
I will login as him and share it with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a
The app is called SanteCeleste. His Appery ID is "a href="mailto:christo@computersetcetera.co.za" rel="nofollow"christo@computersetcetera.co.za/a" Name Christo Du Preez
The form where the problem is is called "DiagnosticDoSelected"

When you test the App us screen size 480 x 800 and -
Press the "Login to Sante Celeste" button'
Then on the Subscriber home screen click "*Dignostics" button'
Then on the "Self Diagnostic Tool" Screen click the "Do Self Diagnostic Test" button.
Select the first item "Indigestion" which will take you to the "DiagnosticDoSelected" screen.
The severity column is where the problem occurs.
Go to the Abdominal Pain line and set the Sevirity to 7 and hit the tab button or click elsewhere. You will see the problem.

Hope my instructions make sense.
I have shared the app with Support


Access dynamic created Input Control that is selected by a user.

Posted: Mon Sep 09, 2013 6:54 pm
by Anton Artyukh5836028

Can you send public link to a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a?


Access dynamic created Input Control that is selected by a user.

Posted: Mon Sep 09, 2013 7:32 pm
by Anton Artyukh5836028

Unfortunately, I can find only Phyzio shared with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a from Christo Du Preez.


Access dynamic created Input Control that is selected by a user.

Posted: Mon Sep 09, 2013 8:44 pm
by Pete Nellmapius

Oh dear.
I have now shared Sante-Celeste with support@appery
Sorry about that.


Access dynamic created Input Control that is selected by a user.

Posted: Mon Sep 09, 2013 8:49 pm
by Anton Artyukh5836028

So, If I change your code to this (in my backup of your project):

prevar inputValue = $(this)&#46;val();
inputValue = parseInt(inputValue, 10);

if (Math&#46;floor(inputValue) == inputValue) {
if (inputValue < 0 || inputValue > 5) {
alert("Value must be between 0 and 5")

Code: Select all

     $(this)&#46;val(""); 
     this&#46;focus(); 
 }; 

} else {
alert("value is not an Integer");
$(this)&#46;val("");
this&#46;focus();
}/pre
I have normal refocusing on input. Your version have typo "$(this).set(0).focus()". And "this.focus();" is the same as $(this).get(0).focus()