Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Gudmrng Everybody,
I have two textboxes one is for Dollar another for cents...My client wants when we enter some Dollar amount and when he press dot it should direct to cents control..ie.next textbox...Is there any possiblity of doing this in javascript..If so please suggest...
Posted

Refer this similar QA:
dollar to cents in c#[^]

..and try this[^] search result first. Try something by your side first, so we can help you to move on. This is not at all appropriate. A simple search on google can solve your question with lots of alternative solutions.
 
Share this answer
 
Comments
Radhika Vyas 10-Sep-12 1:38am    
HiI dont want to conver dollars to cents or something..I seached in google and proceeded in this way like considering the keycode of "." operator and focusing to next textbox...I also applied numeric validations to these two textboxes..Applying number validation and "." validation to same textboxes in javascript didnt work for me...so asking help....
Prasad_Kulkarni 10-Sep-12 1:42am    
So you want javaScript validations, am I getting right?
Radhika Vyas 10-Sep-12 2:56am    
ya..i want javascript validation..dollar textbox shoud accept only numbers and dot operator...if i press "." from my keyboard it shud jump to next box which also accepts only numbers..
http://jsfiddle.net/SbtDM/[^]

check this link.......
 
Share this answer
 
Try This:
ASP.NET
<asp:textbox id="TextBox1" runat="server" onkeydown="KeysShortcut();"></asp:textbox>

<asp:textbox id="TextBox2" runat="server"></asp:textbox>

JavaScript
function KeysShortcut() {
            if (event.keyCode == 190) {

                document.getElementById('<%= TextBox2.ClientID %>').focus();               
            }
        }
 
Share this answer
 
v2
Comments
Radhika Vyas 10-Sep-12 5:05am    
Hi it didnt work for my aspx page...
prashant patil 4987 10-Sep-12 5:27am    
hii radhika..
M updateing my above solution..just try it now..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900