Jump to content

drop down box execution


truegilly

Recommended Posts

Hi People  ;)

 

ive seen this on many e-commerce website and im sure you have too.

 

lets say you have a HTML drop down box and when a user selects a particular value something happens at runtime, like the page refreshes or some area of the page is altered.

 

A good example was on a UK train company website i used to buy tickets from. When you select "railcard" from the drop down box the form adjusts to fit that selection without the browser redirecting to another URL.

 

heres my simple box HTML code....

 

          <select name="type">
            <option>Please Select</option>
            <option value="Risk">Risk</option>
            <option value="Issue">Issue</option>
          </select>

 

what i would love to be able to do is if a user selects "Issue" one of the form fields within the same page is removed.

 

i was thinking about attempting this with the PHP code below...

 

if ($_POST['type'] = 'Issue' {

do something to the form

}
else {

dont cahnge anything !

}

 

the thing that is puzzling me is how this can be done at runtime.

 

Is this at all possible in PHP ?? or is it a javascript thing.  ???

 

Thank you for any help

 

Truegilly  :-*

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.