nmg's Profile User Rating: -----

Reputation: 0 Apprentice
Active Posts:
18 (0.02 per day)
19-April 12
Profile Views:
Last Active:
User is offline Dec 06 2012 11:15 AM

Previous Fields

Dream Kudos:
Icon   nmg has not set their status

Posts I've Made

  1. In Topic: button onclick not triggered

    Posted 8 Nov 2012

    View PostJackOfAllTrades, on 08 November 2012 - 09:19 AM, said:


    <asp:Button ID="LogButton" runat="server" UseSubmitbehavior="true" CssClass="buttonC" Text="Login" onclick="LoginBtnClick" />


    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>";


                   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..?
  2. In Topic: button onclick not triggered

    Posted 8 Nov 2012

    no reply..?
  3. In Topic: adjusting textarea cols by div width

    Posted 29 Aug 2012

    really..? nobody..?
  4. In Topic: problem (probably an easy one)

    Posted 26 Jun 2012

    View Postmodi123_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>


    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)

    View PostDormilich, 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 :smile2:
  5. In Topic: problem (probably an easy one)

    Posted 26 Jun 2012

    View Postmodi123_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.

    View PostDormilich, on 26 June 2012 - 11:40 AM, said:

    View Postnmg, on 26 June 2012 - 08:38 PM, said:

    anyway, it still doesnt work (with the ==)

    but itís not working for a completely different reason.

    the core question here: how do you (resp. JS) do the final calculation?

    when the "calculate" button is being pressed it calls this function:

    function hihuv()
    var x;
      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 Unknown
Birthday Unknown

Contact Information



nmg hasn't added any friends yet.


nmg has no profile comments yet. Why not say hello?