Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Feb 2004
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts

    accessing HTML/PHP forms in javascript

    Right, I have a form that is of the form:
    Code:
    <form name=$name id=$id method=post action=nextpage.php>
    |
    |
    |
    <a href=javascript:
    </form>
    my question is what has to some after the javascript: bit of the href in order to submit this form? Basically I dont know how to access the form name because it is a variable. Can anyone help?
    Thanks.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What happened to the
    <input type="submit" ....


    FYI: You do not put javascript is href anyway.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    Regular Coder
    Join Date
    Feb 2004
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have used <a href="javascript:document.getElementById(...) " before no problem, just not where the form name is a variable. I dont really want a submit button as the page produces a long list so i would prefer links to make the aesthetics nicer really

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <a href="javascript:this.parentNode.name"


    I think should work in your example

  • #5
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Garadon
    <a href="javascript:this.parentNode.name"


    I think should work in your example
    I do not agree with using an anchor.
    But, if I had to, I would use:
    this.form.submit()

    Why don't make a text image and use:
    <input type="image" src="submitImage.jpg">


    .....Willy

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What does the element you use have to do with aesthetics
    Have you heard about CSS???
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #7
    Regular Coder
    Join Date
    Feb 2004
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very much Willy, that idea has saved me a lot of worry

  • #8
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm glad you understood what I was trying to say.
    Because I just reread my post and that sounded renarted.

    .....Willy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •