Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
  1. #1
    Junior Member
    Join Date
    Jan 2003
    Location
    California
    Posts
    8
    Member #
    496
    Hey,
    I'm working on a website right now and I'm using php. I've run into a problem though. I'm wondering if it is possible to have, all in the same form, dropdown boxes with multiple options, and then if your selection isn't listed, an input text box. I've heard some say It can't be done, but It would sure do a lot if I could get it to work. If you could help it would be much appreciated. Thanks

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    As in something like a dropdown that says "Learned about this site from:" and then options like "Google", "Friend", "Other Forum", etc., and "Other", and if "Other" is selected then refer to an inputbox instead? I'm a bit confused.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Junior Member
    Join Date
    Jan 2003
    Location
    California
    Posts
    8
    Member #
    496
    just maybe....

    hey yeah that would probably work... can you show/send me an example link? that would be a lot of help.. if it's what i'm looking for I'll let you know.. Thanks a lot

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    I can help you out tomorrow, unless somebody can jump in sooner.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Junior Member
    Join Date
    Jan 2003
    Location
    California
    Posts
    8
    Member #
    496
    Alright, Thanks.. I'll be checking back here tomorrow i guess unless someone makes a post sooner.
    Thanks

  7. #6
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Try this (I haven't tested it yet):
    Code:
    <select name="choice">
    <option value="somewhere">Somewhere</option>
    <option value="elsewhere">Elsewhere</option>
    <option value="">Other (enter below)</option>
    </select>
    <br>
    <input type="text" name="otherchoice">
    ...and then on the page receiving the form submission (change $_POST to $_GET if appropriate):
    PHP Code:
    $choice $_POST['choice'];
    if (empty(
    $choice)) $choice $_POST['otherchoice']; 
    ...so at that point, $choice will contain either the option the user selected, or if they selected Other, the text that they entered.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  8. #7
    Junior Member
    Join Date
    Jan 2003
    Location
    California
    Posts
    8
    Member #
    496
    hmm...

    ok, that would work for what I originally was looking for... my boss is asking me now if a few other things. Let me see if I can explain this..
    Ok.. he wants one page that let's me enter in the "other" choice into the text field, like you gave me the code for.. Then he wants to know if it is possible to have a submit button under that which would send me to a page exactly like the previous page. The difference is that the "other" in the dropdown box would be gone, and the text field too. Also in the dropdown box, the choice that was entered into the text field would now be there in the dropdown and would be selectable.
    I'm not quite sure how we're going to use this, but I can actually see how it would be useful.. If anyone knows if this is possible or is willing to experiment, let me know. By the way, Thank you for your help filburt1.

  9. #8
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    I personally don't see how it would be useful but that's just me. Either way it would probably require sessions to remember the choice, and I haven't learned them yet.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  10. #9
    Senior Member Rufus's Avatar
    Join Date
    Nov 2002
    Location
    Atlanta, Georgia
    Posts
    115
    Member #
    314
    I don't see how that would be usefull either...

    I know it would need sessions (as filburt said) but maybe you can find something like that at hotscripts? www.hotscripts.com
    "I'm lazy and damn proud of it!"
    - Jordan S. Rains, aka, Me! >_>
    "I saw a car one day, I drove it home, and now the cops are after me for some strange reason."
    - ehem...me again <_<

  11. #10
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    You could build the input text lines as a variable "on the fly"

    Code:
         ActivateButton=""
         ModifyButton=""  
         if instr(Session("PatHead"),"ActiveUser") > 0 and IndexNum >= 0 then
            if instr(ucase(PatData_Array(BoundRange)),ucase(UserName)) = 0 then          
               ActivateButton = ActivateButton & "<input type=submit value='" & ActiveButtonText & "' name='Button'></input><BR>"
            else
               ActivateButton = ActivateButton & "<input type=submit value='" & DeActiveButtonText & "' name='Button'></input><BR>"
            end if       
           ModifyButton = ModifyButton & "<input type=submit value='" & ModifyButtonText & "' name='Button'></input><P>"
         end if   
         
          
    
         PatTableCode = ""
         PatTableCode = ActivateButton & ModifyButton & IndexButton
    Modify and Activate only show up if the conditions are right. You can do this using one page, which would save a lot of headache in using Session Variables.
    DerFarm
    I talk to squirrels.
    Squirrels Answer.


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:36 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com