SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: Trouble using FORM INPUTs

  1. #1
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trouble using FORM INPUTs

    Hey guys...

    I basically want to pass data on to another page using a FORM, with INPUT type = "hidden".

    Problem is, I need to pass the data without using a Submit button nor an Image.

    In other words, I'd like to pass FORM data, using an INPUT type of "hidden", by having a user click on a link on the page, instead of a Submit button or an image.

    Hehe... anyone get my drift...
    Last edited by infinitium; Nov 10, 2002 at 07:57.

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use JavaScript, but that's not a very elegant method. The crafty solution is to use CSS. Here:
    Code:
    <style type="text/css">
    input.submitButton {
        background-color: transparent;
        border: none;
        color: #0000ff;
        cursor: hand;
        text-decoration: underline;
    }
    </style>
    
    <input type="submit" value="Go to the next page" class="submitButton" />

  3. #3
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have a look here

  4. #4
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    javascript solutions will obviously not work if it's disabled or in browsers without javascript (e.g. lynx). is the information so confidential that you don't want your users to see it ? if not, a more elegant way would be to pass the data on in the link's href itself as a GET variable...
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  5. #5
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by redux
    javascript solutions will obviously not work if it's disabled or in browsers without javascript (e.g. lynx). is the information so confidential that you don't want your users to see it ? if not, a more elegant way would be to pass the data on in the link's href itself as a GET variable...
    confidential? ummm.. not really.. but I can't use GET, since the receiving page's an ASP page that uses a Request.Form("Formname") to catch the incoming data.....

    hence the need for passing stuff using a POST method. Will try out all your solns.. thanks!

  6. #6
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm not an ASP person, but i did a quick search and found this http://www.asptutorial.info/sscript/GetandPost.asp
    basically, if i understand it correctly, you can capture GET data via Request.Querystring ...
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  7. #7
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by redux
    i'm not an ASP person, but i did a quick search and found this http://www.asptutorial.info/sscript/GetandPost.asp
    basically, if i understand it correctly, you can capture GET data via Request.Querystring ...
    Yes you can, Redux... but when you do a Request.QueryString (as in when you use a GET) your data is being passed (is visible, rather) via the URL... whereas when you do a POST. your data gets passed behind the scene... all the user sees is the URL without any funny looking text coming after it.

    Hmmm... hope I was right in my explanation.. I'm not an expert in ASP myself

  8. #8
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by mattjacob
    You could use JavaScript, but that's not a very elegant method. The crafty solution is to use CSS. Here:
    Code:
    <style type="text/css">
    input.submitButton {
        background-color: transparent;
        border: none;
        color: #0000ff;
        cursor: hand;
        text-decoration: underline;
    }
    </style>
    
    <input type="submit" value="Go to the next page" class="submitButton" />
    Thanks a bill, Matt.. worked like a charm!

  9. #9
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by infinitium


    Yes you can, Redux... but when you do a Request.QueryString (as in when you use a GET) your data is being passed (is visible, rather) via the URL...
    that's why i asked if your data is confidential and if you want to hide it from your users...
    the CSS solution is nice, but will break in older browsers that do not fully support CSS.
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  10. #10
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by redux
    the CSS solution is nice, but will break in older browsers that do not fully support CSS.
    Nuh-uh, works fine...


  11. #11
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by mattjacob

    Nuh-uh, works fine...

    when i say "break" i mean the look, obviously, not the functionality...
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

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
  •