Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2004
    Location
    Earth
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Probably a very basic question

    Hi all.

    My first post here (registered today) and I'm pretty sure this is the right forum but I might be wrong. Apologies if thats the case.

    I'm after a bit of advice/help if anyone can offer any.

    I have a fairly basic html page that I'm trying to get some data from into a form which is then run through a cgi script.

    The data I want is in a drop-down : basically, the user chooses, say "option 1" from the dropdown, which has a value, eg "1" associated with it. I then hav a submit button below, and I want to be able to extract the "value" data from the dropdown and place it in a non-editable field in the next page. This final page, on submission, runs through a cgi script which emails me the details the user has just supplied, complete with the value from two pages previously. Or, more accurately, at the moment it does nothing because I'm a relative novice and I'm completely stumped. If ness, the "option" could be modified to become the "value" as it were, if this would make it simpler.

    I think JS can do what I'm after, but if not could it be done with .php or .asp?

    I must be honest and say that my knowledge of JS is pretty low to say the least. I'd be after a customisable script if anyone knows of one, as I dont have the know-how to write one myself at the moment.

    Any help anyone could offer would be great.

    Thanks in advance

    RR

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    assuming your 1st page is a form, it should upon submitting it to the next page send the value of the forms element which then in should be accesible in the server language in between.

    for php it could be global defined meaning you would have variables corresponding to the names of the form elements or you can get them in the post,get or request collections.

    you can use echo or print to put the variables value into the input fields on the 2nd page.

    JS can be used to do the same effect but it would require more code, and have the distinct requirement that js is enabled on the browser of the user.

  • #3
    New Coder
    Join Date
    May 2004
    Location
    Earth
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your reply.

    Managed to accomplish it using php after all


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •