combo javascipt and html question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bbxrider

    #1

    combo javascipt and html question

    sorry if this is the wrong newsgroup but not sure which html group it would
    be if really more a html question
    i'm trying to figure a way to enter a value for my form action target right
    on the webpage
    like this,
    <FORM method="Post" action="perl4.p l".........
    i've tried setting a javascript variable to a value entered in a form
    textfield, and using that variable, eg. action=variable Name,
    action=""variab leName"", etc
    but can't seem to find anything that works
    i'm testing various scripts and its a hassle to have to keep editing my
    webpage and resaving it each time i have new script name
    and am thinking this would have other testing applications if it can work
    for other page parameters besides form/action


  • lallous

    #2
    Re: combo javascipt and html question

    hi,

    Once a variable have the value you want, you can modify the form's action
    property as:

    <script>
    document.yourfo rm.action = YourVariable
    </script>

    <form name="yourform" >
    </form>

    hope that hints,

    Regards,
    Elias
    "bbxrider" <bxtrap01@comca st.net> wrote in message
    news:LvCyb.3731 73$HS4.3109453@ attbi_s01...[color=blue]
    > sorry if this is the wrong newsgroup but not sure which html group it[/color]
    would[color=blue]
    > be if really more a html question
    > i'm trying to figure a way to enter a value for my form action target[/color]
    right[color=blue]
    > on the webpage
    > like this,
    > <FORM method="Post" action="perl4.p l".........
    > i've tried setting a javascript variable to a value entered in a form
    > textfield, and using that variable, eg. action=variable Name,
    > action=""variab leName"", etc
    > but can't seem to find anything that works
    > i'm testing various scripts and its a hassle to have to keep editing my
    > webpage and resaving it each time i have new script name
    > and am thinking this would have other testing applications if it can work
    > for other page parameters besides form/action
    >
    >[/color]


    Comment

    • VK

      #3
      Re: combo javascipt and html question

      document.forms( 'yourFormName') .action = yourURL;


      Comment

      • Eric Bohlman

        #4
        Re: combo javascipt and html question

        "VK" <schools_ring@y ahoo.com> wrote in
        news:3fcb0789$0 $22291$9b622d9e @news.freenet.d e:
        [color=blue]
        > document.forms( 'yourFormName') .action = yourURL;[/color]

        document.forms['yourFormName'].action = yourURL;

        Comment

        • bbxrider

          #5
          Re: combo javascipt and html question

          thanks for all the help
          i guess there are a few ways to do it
          i ended up calling a function, setAction()

          return setAction(this. form)

          function setAction(f) {
          f.action=f.elem ents[n].value;
          return;
          }
          still strugglling with this.form vs document.forms

          "Eric Bohlman" <ebohlman@earth link.net> wrote in message
          news:Xns944426E 26F185ebohlmano msdevcom@130.13 3.1.4...[color=blue]
          > "VK" <schools_ring@y ahoo.com> wrote in
          > news:3fcb0789$0 $22291$9b622d9e @news.freenet.d e:
          >[color=green]
          > > document.forms( 'yourFormName') .action = yourURL;[/color]
          >
          > document.forms['yourFormName'].action = yourURL;[/color]


          Comment

          Working...