Pete Nellmapius
Posts: 0
Joined: Thu Sep 05, 2013 1:24 pm

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

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

Pete Nellmapius
Posts: 0
Joined: Thu Sep 05, 2013 1:24 pm

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

// 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

Anton Artyukh5836028
Posts: 0
Joined: Wed May 08, 2013 12:57 pm

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

$(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.

Pete Nellmapius
Posts: 0
Joined: Thu Sep 05, 2013 1:24 pm

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

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.

Anton Artyukh5836028
Posts: 0
Joined: Wed May 08, 2013 12:57 pm

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

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.

Pete Nellmapius
Posts: 0
Joined: Thu Sep 05, 2013 1:24 pm

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

.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

Anton Artyukh5836028
Posts: 0
Joined: Wed May 08, 2013 12:57 pm

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

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

Anton Artyukh5836028
Posts: 0
Joined: Wed May 08, 2013 12:57 pm

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

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

Pete Nellmapius
Posts: 0
Joined: Thu Sep 05, 2013 1:24 pm

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

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

Anton Artyukh5836028
Posts: 0
Joined: Wed May 08, 2013 12:57 pm

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

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()

Return to “Issues”