SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Germany
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Very complex problem

    Hi there,

    I have something for all your gurus out there. I curently work on a project for a news magazine. Clients should get a form where they can select options in order to purchase advertisements in a magazine. It would be to complex to explain the entire thing here. But I do have a general question to start with...

    I need something like http://javascript.internet.com/forms...swapper-2.html

    This would be a good way for them to select areas where the adds should be printed. But when I submit the form I would need the selected items from the right hand box as variables to work on with them in PHP.

    When I select them manually (make them all blue) it works, but I would need something like left box will not be submitted, right box varaibles will be submitted.

    Please ask if I was not clear enough in some points.

    Thanks and best regards,

    ASchweti

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <form........onsubmit="setOptions(list1,false);setOptions(list2,true)">
    Code:
    <script type="text/javascript">
    
    function setOptions(oSelect, bWhich)
    {
    	var opt, i = 0;
    	while (opt = oSelect.options[i++])
    		opt.selected = bWhich;
    }
    
    </script>
    ::: certified wild guess :::

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Germany
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Adios,

    first of all thanks for your reply. Your code "almost" works.

    I've uploaded a DEV page with some code I am working on. Maybe you could have a look? I hope you don't mind that the city names are german http://ihk.digital4u.de

    I believe I have to name the list like this name="list2[]" in order to retrieve an array I can work with in PHP. Not sure if you "speak" PHP, but I am sure you know what I mean

    To make it short and because I am running out of words (it's already 2 am over here)...

    I need to retrieve all data from list2 in PHP, no matt if only one or multiple cities have been selected.

    Best regards,

    ASchweti

    PS: Maybe something like this helps? elements['var[]'];

  4. #4
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Germany
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Adios,

    I've solved it!! You are the man

    Thanks very much,

    ASchweti


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
  •