473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Update labels

I have 2 labels on a page...(weight, age). The user will click on the
label to set the focus on a label. There will be 10 buttons (0-9) on
the page. I want to update the label as the user clicks on the
buttons. Then the user should be able to move to the second label and
enter the numbers by using the buttons. I don't want this to be a
textarea or text but rather a label. How do I do this?

(Newbie to javascript).

Linda
Nov 19 '08 #1
9 2043
On Nov 19, 6:44*pm, Linda <1anml...@gmail.comwrote:
I have 2 labels on a page...(weight, age). The user will click on the
label to set the focus on a label. *There will be 10 buttons (0-9) on
To set the focus on an input?
the page. *I want to update the label as the user clicks on the
buttons. *Then the user should be able to move to the second label and
enter the numbers by using the buttons. *I don't want this to be a
textarea or text but rather a label. How do I do this?
You want a virtual numeric keypad?
>
(Newbie to javascript).
Okay, but it is unlikely that anyone is going to write it for you.

Google "onclick" to get started. Then read up on input elements,
specifically the value property. The solution should be apparent at
that point. If you can't make it work, post the code.
Nov 20 '08 #2
Okay, but it is unlikely that anyone is going to write it for you.
Don't worry about it. I have never and will never ask someone to
"write it for me" unless I want to pay for their work. Just a pointer
would have been helpful. There is a LOT of free javascript code out
there for calculators, etc. They just did not do exactly what I was
looking for.

If you want me to be more specific, when writing a few pages for a web
app for the iPhone, I wanted to find a way to prevent the automatic
keyboards from popping up. There is a numeric one that looks like a
phone pad and has the "ABCs" on it. That doesn't quite suit my
needs. There is an alphanumeric keypad and others that just don't
quite fit what I want to do. I was going to create my own buttons and
update a label with onclick events of these numeric buttons.
Previously, the way that the numeric keyboard was induced to pop up
was if you had an id of phone or zip. This is no longer the case. I
want the user to ONLY enter numbers into the form and I don't want the
automatic iPhone keyboards to pop up.

I will figure it out for myself and then I will share the information
with others on the iPhoneWebDev group. There have been several people
that have experienced a similar problem in that the wrong keyboard for
their needs responds. I will share this with others...unlike what you
were doing. Surely you have asked for help yourself in the past.

Linda
Nov 20 '08 #3
On Nov 19, 10:01*pm, Linda <1anml...@gmail.comwrote:
Okay, but it is unlikely that anyone is going to write it for you.

Don't worry about it. *I have never and will never ask someone to
"write it for me" unless I want to pay for their work. *Just a pointer
would have been helpful. *There is a LOT of free javascript code out
I gave you a couple.
there for calculators, etc. *They just did not do exactly what I was
looking for.
Right.
>
If you want me to be more specific, when writing a few pages for a web
app for the iPhone, I wanted to find a way to prevent the automatic
keyboards from popping up. *There is a numeric one that looks like a
phone pad and has the "ABCs" on it. *That doesn't quite suit my
needs. *There is an alphanumeric keypad and others that just don't
quite fit what I want to do. *I was going to create my own buttons and
update a label with onclick events of these numeric buttons.
Not a label.
Previously, the way that the numeric keyboard was induced to pop up
was if you had an id of phone or zip. *This is no longer the case. *I
want the user to ONLY enter numbers into the form and I don't want the
automatic iPhone keyboards to pop up.
Um, okay.
>
I will figure it out for myself and then I will share the information
with others on the iPhoneWebDev group. *There have been several people
that have experienced a similar problem in that the wrong keyboard for
their needs responds. I will share this with others...unlike what you
were doing.
Gee, sorry. I did my best to help. I have forwarded your complaints
to the customer service manager. Thanks very much for stopping by.
Give my best to the iPhoneWebDev group (whatever that is.)
Surely you have asked for help yourself in the past.
No, I have never posted a question here. Well, maybe once and I
probably had my terminology straight and posted some code. You can
search the archives if you are interested.

Have a nice day! :)
Nov 20 '08 #4
Have a nice day! *:)

I truly hope that you do as well.
Nov 20 '08 #5
OK. Trying again and I hope that I don't anger or frustrate the
professionals on this forum.

Is there any control that can be updated in real time with the use of
numbered buttons other than a text control? As the user clicks on a
button, this control will be updated.

I will have buttons for 0-9 and a decimal on a page. I want the user
to be able to enter numbers only and so will provide the buttons. For
example, the user would be entering age and weight. This is not a
calculator type of web app. It would have several controls that the
user would enter data into the page.

This will be for viewing on an iPhone and what I am trying to prevent
is the automatic pop-up of the iPhone keyboards if the user taps on
the control. If it is a text input control, the keyboard on the
iPhone automatically pops up. I don't want that. They automatic
keyboard covers too much screen space. So, is there another type of
control that can be edited using Javascript from clicking on the
buttons?

I have also tried a label but the keyboard pops up with this as well.

Is a div an option? Is a cell in a table possible? Some non-standard
control that I can re-use that someone else has created? Even if I
have to purchase the code for it? All that I am really looking for is
an idea. I am not looking for the code. I am not looking for someone
to write this for me unless it is already in common use or it is
available for purchase to re-use the code. I am not a parasite...only
looking for a suggestion from people that obviously know more about
javascript than I do.

Thanks,
Linda
Nov 21 '08 #6
On Nov 21, 1:22*am, Linda <1anml...@gmail.comwrote:
OK. *Trying again and I hope that I don't anger or frustrate the
professionals on this forum.

Is there any control that can be updated in real time with the use of
numbered buttons other than a text control? As the user clicks on a
button, this control will be updated.
You can update the text of any element. Google for "textContent" and
"innerText." Still, it would make sense to use a text input in this
case (set its value property.)
Nov 21 '08 #7
On Nov 21, 12:45*am, David Mark <dmark.cins...@gmail.comwrote:
You can update the text of any element. *Google for "textContent" and
"innerText."
Thank you.
>Still, it would make sense to use a text input in this
case (set its value property.
Afraid not. Even if it is not editable, that property is only
accessed after the keyboard pops up...which is what I want to prevent.

Linda
Nov 21 '08 #8
Linda wrote:
On Nov 21, 12:45 am, David Mark <dmark.cins...@gmail.comwrote:
>Still, it would make sense to use a text input in this case (set its
value property.

Afraid not. Even if it is not editable, that property is only
accessed after the keyboard pops up...which is what I want to prevent.
You are not making sense. A text input *is* a control "that can be updated
in real time with the use of numbered buttons". And "as the user clicks on
a button, this control will be updated."

Please learn to quote: trim the parts that are not referred to, leave the
parts that are referred to, over several quotation levels if necessary.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Nov 21 '08 #9
SAM
Le 11/20/08 12:44 AM, Linda a écrit :
I have 2 labels on a page...(weight, age). The user will click on the
label to set the focus on a label. There will be 10 buttons (0-9) on
the page. I want to update the label as the user clicks on the
buttons. Then the user should be able to move to the second label and
enter the numbers by using the buttons. I don't want this to be a
textarea or text but rather a label. How do I do this?
What can be a label for you ?
To create and display a virtual numeric keyboard is not too much difficult.

I don't know the iPhone, and I don't use internet on my mobile, but it
seems to me that my children use their phones to send SMS ? I think they
have a kind of autosuggestion when writing but not a popup keyboard.

If the question is how to abort the iPhone's keyboard popup, I don't know.

If the question is how to set a tag reacting to a click, here it is :

<tag onclick="numKeyBd(this);">age: <span></span></tag>
function numKeyBd(what) {
var k = document.getElementById('numKeyBoard');
k.label = what.getElementsByTagName('span')[0];
what.parentNode.appendChild(k);
k.style.display = 'block';
}

Then you create a DIV idded 'numKeyBoard' with your 12 buttons
(don't forget the backspace)

<button value="9" onclick="return entree(this);">9</button>
....
<br>
<button value="0" onclick="return entree(this);">0</button>
<button value="." onclick="return entree(this);">.</button>
<button onclick="return delLastEnter();">&lt;</button>
<br>
<a href="javascript:closeKB();">close</a>
</div>
function entree(quoi) {
var c = document.getElementById('numKeyBoard').label;
c.innerHTML += quoi.value;
return false;
}

function closeKB() {
document.getElementById('numKeyBoard').style.displ ay = 'none';
}

--
sm
Nov 22 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Hexman | last post by:
In my program I have several labels that I want to update with information that is being processed in a calculation module. I have code similar to the following in my module. As it goes through...
1
by: Benny | last post by:
I have a GUI and a working thread. I have used just regular labels and used callbacks to update the text on the GUI thread until now. I have added a status bar with 2 labels i need to be able to...
8
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
0
by: Elmo Watson | last post by:
I've got quite a few textboxes on my page, along with labels, within a table. In these textboxes, I use the onTextChanged event (with autopostback=true) to calculate some formulas, and put the...
1
by: John | last post by:
Hi there I've got a form that when the cursor hovers over an image I update 10 labels to show different numbers. At the moment the form is redrawing each time I update one label, this means it...
1
by: geeteshss | last post by:
Dear all, actually i spent a whole month on the R&D of datagrid edit ,update,cancel events but recently my guide told me to make it user friendly because no user would like to go on searching rows...
6
by: 85ssp | last post by:
I have a server applicatoin that has a multitude of labels related to the clients connected to it. When I have a number near 50 clients and i recieve a updatated status from each of the clients at...
4
by: Dr Al | last post by:
I have a project which requires the batch import of customer contact information, print mailing labels for those customers who have their date of first letter field in the database set to null, and...
0
by: Mike | last post by:
Is it possible to create an XML file to read from using a dropdown and based on the selection read the XML file again to populate some labels? Also, is it possible to update an XML file based on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.