how to get action property, with element name 'action'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • garpun
    New Member
    • Dec 2006
    • 2

    how to get action property, with element name 'action'

    Code:
    <head>
    <script>
    function getAction() {
    alert(document.forms[0] .action);}		
    }
    
    </script>
    </head>
    <body>
    <form action='la-la-la.html' method=get>
    <input name=action type=text>
    <input type=submit>
    
    </form>
    <input type=button value='GET!!' onClick='getAction();'>
    
    </body>
    So, getAction() return that 'action' is object, but how to get form object property.
    Is it possible from function getAction()???
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Code:
    function getAction() {
    alert(document.forms[0].action.value);
    Ronald :cool:

    Comment

    • garpun
      New Member
      • Dec 2006
      • 2

      #3
      Originally posted by ronverdonk
      Code:
      function getAction() {
      alert(document.forms[0].action.value);
      Ronald :cool:
      but I want to get la-la-la.html

      Comment

      • AricC
        Recognized Expert Top Contributor
        • Oct 2006
        • 1885

        #4
        Originally posted by garpun
        Code:
        <head>
        <script>
        function getAction() {
        alert(document.forms[0] .action);}		
        }
         
        </script>
        </head>
        <body>
        <form action='la-la-la.html' method=get>
        <input name=action type=text>
        <input type=submit>
         
        </form>
        <input type=button value='GET!!' onClick='getAction();'>
         
        </body>
        So, getAction() return that 'action' is object, but how to get form object property.
        Is it possible from function getAction()???
        Are you trying to get the action of the form? I'm not sure what you mean byu get form object property?

        Comment

        • nypee
          New Member
          • Mar 2008
          • 1

          #5
          I have the same problem. Did you manage to do that?

          Originally posted by garpun
          but I want to get la-la-la.html

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Is this problem in IE6 or all browsers?

            Comment

            Working...