SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2002
    Location
    Oslo
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Submit content from a div tag

    I have a div tag with text fields that I want to submit when user press the "Send" button (see code below). How can I do that?
    Code:
    <div id="anmelderBoks">
     Title: <input name="title" type="text" class="txtbred"/>
     <br /><br />
         Title2: <input name="title2" type="text" class="txtbred"/>
     <input name="Send" type="button" class="btnBoks" onclick="MM_showHideLayers('anmelderBoks','','hide');MM_showHideLayers('anmeldelseSendt','','show')" value="Send"/>
    </div>

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use a FORM instead of a DIV.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dude you must wrap vhole this with form tag, or make the div a form tag, this would be a regular solution. Anyway i think you can submit it like querystring in this way:

    Code:
    <div id="anmelderBoks">
    
    Title: <input name="title" type="text" class="txtbred" id="submitThis"/> <br /><br /> Title2: <input name="title2" type="text" class="txtbred"/> <input name="Send" type="button" class="btnBoks" onclick="MM_showHideLayers('anmelderBoks','','hide');MM_showHideLayers('anmeldelseSendt','','show'); window.location='?submitThis=' + document.getElementById('submitThis').value; " value="Send"/>
    </div>
    NOTELAY.COM - Have a nice noty day
    ETA CONSULTING


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
  •