Simple - UD Function with Select / Option

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Hoffmann

    Simple - UD Function with Select / Option

    Hello,
    As you might guess I am completely new to this language. Maybe I get some
    help here.
    I try to execute a user defined funciton from a select option in a document
    to read a file
    into an array without using a submit button or anything else.
    like this:
    <select name="sel[]" onchange="<?php ReadFile(Depend ingOnValue);<?" >
    <option value="1"> 1st Quarter </option>
    <option value="2"> 2nd Quarter </option>
    <option value="3"> 3rd Quarter </option>
    </select>

    I know I could use Javascript instead. But I am sure there is an easy way
    doing in PHP.

    Many thanks for your help

    Michael





  • Andy Hassall

    #2
    Re: Simple - UD Function with Select / Option

    On Mon, 26 Jan 2004 23:51:17 +0100, "Michael Hoffmann"
    <michael@steine frenz.net> wrote:
    [color=blue]
    >As you might guess I am completely new to this language. Maybe I get some
    >help here.
    >I try to execute a user defined funciton from a select option in a document
    >to read a file
    >into an array without using a submit button or anything else.
    >like this:
    ><select name="sel[]" onchange="<?php ReadFile(Depend ingOnValue);<?" >
    ><option value="1"> 1st Quarter </option>
    ><option value="2"> 2nd Quarter </option>
    ><option value="3"> 3rd Quarter </option>
    ></select>
    >
    >I know I could use Javascript instead. But I am sure there is an easy way
    >doing in PHP.[/color]

    You're wrong. PHP only executes on the server, when the form is submitted,
    i.e. there is a request to the server. onChange is a client-side event that
    does not cause a request, unless you use JavaScript to submit the form.

    --
    Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
    <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>

    Comment

    Working...