nmg's Profile
Reputation: 0
Apprentice
- Group:
- Members
- Active Posts:
- 18 (0.05 per day)
- Joined:
- 19-April 12
- Profile Views:
- 218
- Last Active:
Dec 06 2012 11:15 AM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: button onclick not triggered
Posted 8 Nov 2012
JackOfAllTrades, on 08 November 2012 - 09:19 AM, said:$("#LogOutBtn")
<asp:Button ID="LogButton" runat="server" UseSubmitbehavior="true" CssClass="buttonC" Text="Login" onclick="LoginBtnClick" />
Maybe?
well i've tried changing
//newHTML += "<span><input type='button' id='ProfileBtn' height='30px' width='40px' runat='server' class='buttonC' value='My Profile' onclick='MyProfileBtnClick' /><br />"; //newHTML += "<input type='button' id='LogOutBtn' height='30px' width='40px' runat='server' Class='buttonC' value='Logout' onclick='LogoutBtnClick' /></span>";
to:
newHTML += "<span><asp:Button ID='ProfileBtn' Height='22px' Width='50px' runat='server' UseSubmitbehavior='false' CssClass='buttonC' Text='My Profile' onclick='MyProfileBtnClick'></asp:button>"; newHTML += "<asp:Button ID='LogOutBtn' Height='22px' Width='50px' runat='server' UseSubmitbehavior='false' CssClass='buttonC' Text='Logout' onclick='LogoutBtnClick'></asp:button></span>";
( in the asp.net part in changeLoginDiv() )
but, well, the buttons just disappear =\
no idea why.
I checked in the google chrome view code, and it says both the buttons are (1px X 16px), although in the code it says that the width and height are 50,22 like i wrote in the string.
any help..? -
In Topic: button onclick not triggered
Posted 8 Nov 2012
no reply..? -
In Topic: adjusting textarea cols by div width
Posted 29 Aug 2012
really..? nobody..? -
In Topic: problem (probably an easy one)
Posted 26 Jun 2012
modi123_1, on 26 June 2012 - 11:50 AM, said:What does ".innerHTML" take? A string, right? One concatenates strings with plus-signs.. so when you end up with a string that is "5+6=11" after telling it to take in 'nFirst + sim + nS + "=" + x;' what were you expecting it to do otherwise?
this VV
<p id="demo">blabla</p>
nFirst is supposed to be the number of the first button that is being pressed, sim should be the mathematical operator, and nS should be the second button that is being pressed. (this code: )
<button type="button" onclick="hihuv()">calculate</button> <br> <button type="button" onclick="click(7)">7</button> <button type="button" onclick="click(8)">8</button> <button type="button" onclick="click(9)">9</button> <br> <button type="button" onclick="click(4)">4</button> <button type="button" onclick="click(5)">5</button> <button type="button" onclick="click(6)">6</button> <br> <button type="button" onclick="click(1)">1</button> <button type="button" onclick="click(2)">2</button> <button type="button" onclick="click(3)">3</button> <br> <button type="button" onclick="click(0)">0</button> <br><br> <button type="button" onclick="click('+')">+</button> <button type="button" onclick="click('-')">-</button> <button type="button" onclick="click('*')">*</button> <button type="button" onclick="click('/')">/</button> <br>
and:
function click(f) { if(lvl == 0) { nFirst = f; lvl++; } if(lvl == 1) { sim = f; lvl++; } if(lvl == 2) { nS = f; lvl++; } }
so if i press 7, then *, and then 3, it will write "7*3 = 21" (when 21 is x that is being calculated in the hihuv() function, which works all right)
Dormilich, on 26 June 2012 - 11:56 AM, said:they don’t because you named the function click(). and click() is a standard function on clickable targets. or put in simpler words, click is a reserved keyword in HTML-JS.
oh, well, that's the problem when you (well, me) need to write the code in the notepad (unlike c# or c++ which i know)..
=\
thanks for the help
-
In Topic: problem (probably an easy one)
Posted 26 Jun 2012
modi123_1, on 26 June 2012 - 11:39 AM, said:Okay - so new code.. and that means a new explanation of "it still doesnt work ".
well, same thing exactly
no errors, gives me "5+6=11" everytime.
Dormilich, on 26 June 2012 - 11:40 AM, said:
when the "calculate" button is being pressed it calls this function:
function hihuv() { var x; switch(sim) { case '*': x = nFirst * nS; break; case '/': x = nFirst / nS; break; case '+': x = nFirst + nS; break; case '-': x = nFirst - nS; break; } document.getElementById("demo").innerHTML = nFirst + sim + nS + "=" + x; nFirst = 0; nS = 0; sim = 0; lvl = 0; }
it is supposed to be called after a number button, sign button, and another number button were clicked (so nFirst, sim, and nS will have the values of the buttons. but they dont).
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Private
Friends
nmg hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
nmg has no profile comments yet. Why not say hello?