Open Source & Stuff  
  |     Main Site     |      Forum     |     Contact     |
Ajax Linked Select boxes :  forum.Salix.gr forum.Salix.gr
Comments, questions, usage, bugs. 
Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
messageForce / require select
Posted by: DonnaNj (IP Logged)
Date: November 07, 2008 09:41AM

I have a 3 link select

Make Model Year


[www.qualitypowerauto.com]


We're finding folks pick Make / Model and then hit submit (maybe they are hoping to get all the years ?) .. but instead they get nothing.

Is there a way to force them to pick all three - or at least to default to something else if they don't pick ?

Thanks

Donna

messageRe: Force / require select
Posted by: panos (IP Logged)
Date: November 11, 2008 08:06AM

Hi,
this is up to your search script, if user let "Please select" option then you will get a 0 as selected id.
So you have Make=make12 Model=model235 and Year=0. What you need is to check $_POST['Year'] if is 0 to exclude that field from where clause,
select * from spare_parts where make='make12' and model='model235'
instead of quering
select * from spare_parts where make='make12' and model='model235' and year=0

that's what i think smiling smiley



Sorry, only registered users may post in this forum.

All Rights Reserved 2006 Salix.gr  |  Design by Ades Design |  Hosting by e-emporio |  forum.Salix.gr powered by Phorum