SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast inderpal.singh's Avatar
    Join Date
    Jul 2006
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    FORM inside FORM

    Hi All,

    I have something like FORM inside another FORM.

    Code:
    <form method="post" action="value.cgi">
    <input type="submit" name="remove" value="Remove" />
    <form><input size="8" type="text" name="gpricecode" value="" /></td>
    <td align="left"><input type="submit" name="recalc" value="Update Total" /></form></form>
    When I enter in value for gpricecode and hit the Enter button of keyboard, "update total" does not work, instead the form defaults to the "remove" and I can't seem to fix it...

    What I want is to when I hit Enter after putting in some value for gpricecode, it will defualt to the "Update Total" form and not to the remove button....

    I would appreaciate any help in this regard. Thanks in advance!!

    Best Regards,
    Inderpal Singh

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,789
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    You can't put one form inside another. Either you have ONE form or the second form needs to be moved.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Enthusiast inderpal.singh's Avatar
    Join Date
    Jul 2006
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But it's working properly. The only problem I am facing is when user hits the Enter key otherwise if use a mouse to hit buttons with mouse, All the actions are working properly.

    Best Regards,
    Inderpal Singh

  4. #4
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which browsers did you test that in though?

    I doubt it will "work properly" in all of them.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  5. #5
    SitePoint Enthusiast inderpal.singh's Avatar
    Join Date
    Jul 2006
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's working fine both in IE as well as in Firefox. Anyway, never mind. I just disabled the user to hit the Enter key.

  6. #6
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about Opera, Safari, and IE5/Mac?

    Well we warned you anyway.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


Bookmarks

Posting Permissions

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