SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    T.O., Canada
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Possible to use POST method without 'submit' button?

    Is it possible to pass variables to the next page using POST method, without using the 'submit' button? Or is that the only way you can do it?

  2. #2
    Wibblesticks Gryff's Avatar
    Join Date
    Oct 2001
    Location
    Asgard
    Posts
    442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you can use a mouseover or those kinds of things
    you need the javascript forum/s

  3. #3
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may use an image as well:
    Code:
    <input type="image" src="/path/to/image.ext" style="width : Xpx ; height : Xpx ; border : 0px ;" />


    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  4. #4
    Wibblesticks Gryff's Avatar
    Join Date
    Oct 2001
    Location
    Asgard
    Posts
    442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was going to mention that but if you have to click an image its really just a different button isnt it

  5. #5
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use header() function, but no post, or make a submit button like a regular button with hidden fields with 'post'.

  6. #6
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    T.O., Canada
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by johnn
    You can use header() function, but no post, or make a submit button like a regular button with hidden fields with 'post'.
    Can you elaborate a bit on this johnn? How would I use the header() function? Where do I specify which page is the page that the variables are passed to?

    And I don't quite understand what you said about making a submit button like a regular button with hidden fields. How do you make type='submit' AND type='hidden' at the same time??
    Last edited by ForzaGrifo; May 5, 2002 at 17:52.

  7. #7
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    T.O., Canada
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Gryff
    I was going to mention that but if you have to click an image its really just a different button isnt it
    Yeah I think it would be just like a different button, which is something I don't want.

    Basically I want to just click a normal text link to pass the variables, without using GET or appending query string to the URL. This is because my query string would be 1500 characters and some older broswers would crash because it exceeds the limit. Any idea how?

  8. #8
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you want to click a normal text link, you can create a gif image with that text with transparent background. Users don't see different.

    Anyway, an example what I do is in the form:
    as you say submit button can have any value. In example I use an image 'mapit' as button:
    PHP Code:
    <body bgcolor="#FFFFFF">
    <
    form name=addressForm action="http://www.nextpage.php?a=10&c=SA&st=CA" method="post">

    <
    input type=hidden name=country value=US>
            <
    td rowspan=11 width=5>
            <
    img src="http://www.com/dci_global/spacer" width=5 height=1 border=0 alt=""></td>
            <
    td colspan=class=areaHeader2 width=170>find a U.Smap</td>
        
        <
    tr>
            <
    td colspan=3 height=5 width=170><img src="http://www.com/dci_global/spacer" width=1 height=5 border=0 alt=""></td>
        </
    tr>
        <
    tr>
            <
    td colspan=3 width=170>
            <
    b>Enter as much information as you know:</b></td>
        </
    tr>
        <
    tr>
            <
    td colspan=3 height=5 width=170><img src="http://xxx.com/dci_global/spacer" width=1 height=5 border=0 alt=""></td>
        </
    tr>
        <
    tr>
            <
    td colspan=3 width=170>Address or Intersection:<br>
            
          <
    input type=hidden class=formField1 name=address size=21 maxlength=80 style=width:160 value="3130 Harbour Blvd">
        </
    td>
        </
    tr>
        <
    tr>
            <
    td colspan=3 height=5 width=170><img src="http://xxx.com/dci_global/spacer" width=1 height=5 border=0 alt=""></td>
        </
    tr>
        <
    tr>
            <
    td colspan=3 width=170>City:<br>
            
          <
    input type=hidden name=city class=formField1 size=21 maxlength=50 style=width:160 value="Santa Ana">
        </
    td>
        </
    tr>
        <
    tr>
            <
    td colspan=3 height=5 width=170><img src="http://xxx.com/dci_global/spacer" width=1 height=5 border=0 alt=""></td>
        </
    tr>
        <
    tr>
            <
    td width=40>State:<br>
            
          <
    input type=hidden name=state class=formField1 size=2 maxlength=2 style=width:55 value="CA">
        </
    td>
            <
    td width=10><img src="http://xxx.com/dci_global/spacer" width=10 height=1 border=0 alt=""></td>
            <
    td width=120>Zip Code:<br>
            <
    input type=hidden name=zipcode class=formField1 size=11 maxlength=10 style=width:93>

        </
    td>
        </
    tr>
        <
    tr>

    <
    input type=image border=0 name=homesubmit
            src
    ="http://xxx.com/mqsite_english/mapit">
    </
    form
    Last edited by johnn; May 5, 2002 at 18:04.


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
  •