SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting and sending a form with JS

    Hi, i have a function that fires once some button is pressed

    Code:
    {
    document.form1.submit();
    }

    This submits the form correctly, but inside form1 I have a hidden field called SubmitBo. THe form submits to an ASP page that uses Request.Form("SubmitBo") to determine what to do.

    My questions is, how can I (inside my JS function) set the value of SubmitBo such that the ASP Request will pick it up correctly??

    Thanks for any help.

  2. #2
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'd have to give it an ID first:
    Code html4strict:
    <input type="hidden" value="whatever" id="SubmitBo" name="SubmitBo" />

    And then you can change it's value:
    Code JavaScript:
    document.getElementById('SubmitBo').value = "NEW VALUE";
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  3. #3
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx that worked


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
  •