SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Javascript Gurus:

    I have a form that I'm trying to submit with buttons in a different frame. For the most part it works, but there are a couple instances where it doesn't. It works fine when I just need to script to display different things, but when I need to update some info, then the js doesn't seem to work. I'm wondering if this is even possible.

    using onSubmit and onClick hasn't worked. The form is normally submitted by an image type input. This is the js I'm trying right now.
    Code:
    <form>
    <INPUT TYPE="image" src="../buttons/but_aendern_r.gif" ALIGN=TOP BORDER="0" onClick="top.mainFrame.document.forms[0].submit()">
    </form>
    And then the script is looking for:
    Code:
    $form_data{'what_to_do_next.x'}
    Since the page comes back blank and no data has been written to the file that is supposed to have the data written to it, I can only guess that the script is not getting that value, so it just exits. Is there a way to pass that value from a different frame? Is the problem that the form is not normally sent with a submit button?

    I hope I explained this clearly.
    TIA
    --Bill
    Lake Superior Smokin' Brews Make It Different: Brew Your Own!
    L'Etoile du Nord Web Development Providing Real Direction in a Virtual World
    MSN IM: smokinbrews-AT-hotmail-DOT-com
    Brewin', Vintin' & Smokin' Forums Moderator

  2. #2
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try changing your image input to a normal img tag, and surround it with an href, like so:

    <a href="javascriptarent.otherframename.document.formname.submit()"><img src="image.gif" height="100" width="100"></a>

    Netscape doesn't officially recognize an image as an input type. Netscape would submit the form, but you can't use an onClick event handler on the image input type - Netscape won't see it. Netscape also won't know that you clicked on the image and the value for yourButtonName.x won't be available.


    If you don't care about Netscape, try the JavaScript code from above in your onClick...

    onClick = "parent.otherframename.document.formname.submit();"

    Also, where does 'what_to_do_next' come in to play in your code?

  3. #3
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    P.S. The little green guy with his tongue out is not required in the href tag.

  4. #4
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm, how would I embed a pplbbt guy into my code?

    I'll give that a try, thanks.

    The what_to_do_next is for the perl script that the form is submitted to. That part needs to be submitted with the form (it's part of an image-type input and works fine when everything is done in one frame)

    --Bill
    Lake Superior Smokin' Brews Make It Different: Brew Your Own!
    L'Etoile du Nord Web Development Providing Real Direction in a Virtual World
    MSN IM: smokinbrews-AT-hotmail-DOT-com
    Brewin', Vintin' & Smokin' Forums Moderator

  5. #5
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    didn't work.

    --Bill
    Lake Superior Smokin' Brews Make It Different: Brew Your Own!
    L'Etoile du Nord Web Development Providing Real Direction in a Virtual World
    MSN IM: smokinbrews-AT-hotmail-DOT-com
    Brewin', Vintin' & Smokin' Forums Moderator

  6. #6
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got it working. Ended up not being a javascript issue at all.

    --Bill
    Lake Superior Smokin' Brews Make It Different: Brew Your Own!
    L'Etoile du Nord Web Development Providing Real Direction in a Virtual World
    MSN IM: smokinbrews-AT-hotmail-DOT-com
    Brewin', Vintin' & Smokin' Forums Moderator


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
  •