RTSol
asked on
get text from inpu
Hi,
I am trying to get the text from an input of type text like so:
What is wrong?
Best regards
RTSol
I am trying to get the text from an input of type text like so:
<input type="text" id="inpAvg" name="gasaverage" value="" style="width: 60%;" />
with this jQueryvar avg = $("#inpAvg").val();
but it returns an empty string no matter what I put in the input.What is wrong?
Best regards
RTSol
You should remove the value="" part of the input HTML.
ASKER
It's very dtrange but nothing of the above works fro me. The input resides inside a view in a hybrid mobile app. I am going nuts. Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It's a lot of code but the id is unique
provide a link this website
ASKER
Well - it is a mobile app so I can't.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi guys,
Sorry for the delay. It actually was a problem with multiple IDs. I was using requirejs and didn't realize that all the html was lodaed when the app was run. stupid of me - thanks.
Best regards
RTSol
Sorry for the delay. It actually was a problem with multiple IDs. I was using requirejs and didn't realize that all the html was lodaed when the app was run. stupid of me - thanks.
Best regards
RTSol
<input type="text" id="inpAvg" name="gasaverage" value="IM NOT EMPTY" style="width: 60%;" />