1. Welcome to DNTrade. If you want to find out about the latest domain name industry news or talk, share, learn, buy, sell, trade or develop domain names - then you've come to the right place. It's a diverse and active community, with domain investors, web developers and online marketers - and it's free! Click here to join now.
    Dismiss Notice

Need help with Javascript!

Discussion in 'Web Development' started by Webfunk, Apr 28, 2011.

  1. johno69

    johno69 Membership: VIP

    Joined:
    Nov 29, 2008
    Messages:
    2,663
    Likes Received:
    422
    auDA Member:
    Yes
    thousand seperators went out in the 80's.
     
  2. Webfunk

    Webfunk Membership: Community

    Joined:
    Apr 12, 2011
    Messages:
    129
    Likes Received:
    0
    Thanks for that useless piece of information.
     
  3. sp@rky13

    sp@rky13 Membership: Community

    Joined:
    Apr 5, 2011
    Messages:
    464
    Likes Received:
    0
    According to this use addcommas()
     
  4. Webfunk

    Webfunk Membership: Community

    Joined:
    Apr 12, 2011
    Messages:
    129
    Likes Received:
    0
    Yeah I had a look at that earlier but couldn't figure out how to integrate it into my html...

    <a href="#TB_inline?height=360&width=380&inlineId=popup" class="thickbox">
    <input type="button" name="Button" value="OK" class="OK" onClick="calculateTotal(); true;" /></a>
    <div id="popup">
    <p class="popuph1">Your Savings:</p>
    <span class="symbols2">$</span><input name="total" id="total" type="text" class="result" readonly="readonly" />

    I want the calculation (input class="result") to show the formatting.
     
  5. sp@rky13

    sp@rky13 Membership: Community

    Joined:
    Apr 5, 2011
    Messages:
    464
    Likes Received:
    0
    Have a variable equal it and then pass that to the result...?
     
  6. johno69

    johno69 Membership: VIP

    Joined:
    Nov 29, 2008
    Messages:
    2,663
    Likes Received:
    422
    auDA Member:
    Yes
    Sorry. I was serious.
     
  7. Webfunk

    Webfunk Membership: Community

    Joined:
    Apr 12, 2011
    Messages:
    129
    Likes Received:
    0
    I'm trying to default a value of a text field to 0, if the user does not submit anything. Does the following code illustrate this or have I got it all wrong?

    function checkValue() {
    var defaultValue;

    defaultValue = 0;

    if ((document.getElementById("otherFees").value)=="")
    (document.getElementById("otherFees"))=defaultValue;
    }
     
  8. Webfunk

    Webfunk Membership: Community

    Joined:
    Apr 12, 2011
    Messages:
    129
    Likes Received:
    0
    what would this code look like? I am novice when it comes to javascript...
     
  9. sp@rky13

    sp@rky13 Membership: Community

    Joined:
    Apr 5, 2011
    Messages:
    464
    Likes Received:
    0
    I'm not someone who's coded very much javascript before (you've probably done more than me) so I'm just thinking out loud in terms of how it would work in any language
     
  10. Webfunk

    Webfunk Membership: Community

    Joined:
    Apr 12, 2011
    Messages:
    129
    Likes Received:
    0
    okay, thanks mate :)