alert the destination of form

Discussion in 'JavaScript' started by gilgalbiblewheel, Mar 31, 2010.

  1. #1
    I have a form which I want to see where it's directing.
    [B]onclick="alert(window.location);"[/B]
    Code (markup):
    That doesn't seem correct. How do I do it?
     
    gilgalbiblewheel, Mar 31, 2010 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #2
    You can do it two ways

    1. If you form has a name
    
    alert(document.myform.action);
    
    Code (markup):
    2. If you form has an id
    
    alert(document.getElementById('myform').action);
    
    Code (markup):
     
    stephan2307, Apr 1, 2010 IP