Jump to content

Recommended Posts

Im wondering if this is possible with PHP, but im leaning to believe that it is not.

 

Question:

I want to have 2 combo boxes on form, holding a list of dates.  When i change Combobox 1(which will hold the beginning data), ComboBox 2 will update itself to the data held in Combobox 1, and will not be able to select dates held before the date held in combobox 1.

 

Example:

Combo 1 holds 05/03/2007

Combo 2 now holds 05/03/2007, but cannot select anything prior to 05/03/2007

 

Im thinking that it can only be done through JS.  But if it is possible with PHP, i'd rather pursue that method.  (i hate JS)

 

If JS is the only way to go, do any of you know a user-friendly JS out there that full fills this task?

 

Cheers in advance

 

Gnub.

Link to comment
https://forums.phpfreaks.com/topic/41477-possible-without-javascript/
Share on other sites

Well, you can do it with PHP, but it requires a page refresh and posting data to the server.  That's not necessarily a bad thing.  To do it without PHP does require javascript, and I don't know of any scripts that already do that.  Looks like you're writing your own!

well, yes, it's possible to update dropdowns using only php, but he asked if it was possible to update it when he changes the value of checkbox #1.  I'm am just going to assume (like all the 100's of other people who ask...) that he wants #2 to automatically update when he makes a new selection, before he actually does any kind of submitting or refreshing or anything.  No, that's not possible (with only php). 

 

If the options are based on info in a database or something on the server, look into ajax.

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.