android - Setting the value in a select dropdown using javascript -
I'm having trouble trying to set the value in a select I see NaN as my result (some In browsers - primarily Android smartphone / tablet default browser)
I'm just running the statement and setting the value if the status is correct:
(Variable1> = variable2) {$ (select '[title = "title"]'). Val (variable1); } Where a 'typeof' check shows both variables 1 and variable2 if if statement shows them as both numbers. Despite this, the value shown in the selection in the browser is ne'en.
I have also tried to wrap the JavaScript number () function around the variables:
if (number 1)> number = (variable 2 )) {$ (Select [title = "myTitle"]). Val (number (variable 1)); } But I still get the same result!
Note: It works fine in desktop / laptop browsers and works also on Opera Mobile on my Samsung Galaxy S2, working towards making it an app to run on any phone I'm looking forward to complete my error checking.
Edit: If this is my selection, then what is wrong with this problem (as described below)? Is it because I am converting it to a string at that point I return it to?
var startPoint = this.do_calcTotal (); // shows the form of startpoint number, and pays = start page + 12; // type of end points as the number mySelect = '& lt; Select title = "myTitle" class = "myClass"> '; (O = start page; o & lt; end point; o ++) {mySelect + = '& lt; Option & gt; ' + Number (o) + '& lt; / Option & gt; '; // Is it true?? It shows as 'o' and 'number (o)' type number! } MySelect + = '& lt; / Select & gt; & Lt; / Span & gt; & Lt; / Div & gt; '; Select me; Edit: and code to add the currently selected value to display ...
function do_changeNumberSpan (value) {$ ('. MySpan ') text (number (value)). // Try to throw a number (even) round here! }
OK check out this jsfiddle should help you understand that What is your goal ... and how you can accomplish it
Comments
Post a Comment