mypopy Posted November 9, 2006 Share Posted November 9, 2006 Hi everyoneAnyone can help?What I am trying to do is:I have a s dropdown list on the first page. When I select from the first drop down is not retaining the value,I want dropdown list retain the chosen values . How can I do that?Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/26667-how-to-retain-dropdown-list-value/ Share on other sites More sharing options...
Psycho Posted November 9, 2006 Share Posted November 9, 2006 You are not giving enough information. Are you submitting the form to the same page which displays the form again? Need to see how you are building your select list. Link to comment https://forums.phpfreaks.com/topic/26667-how-to-retain-dropdown-list-value/#findComment-121994 Share on other sites More sharing options...
mypopy Posted November 9, 2006 Author Share Posted November 9, 2006 Yes I am sending it to one form I've attached the codingThanx[attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/26667-how-to-retain-dropdown-list-value/#findComment-122008 Share on other sites More sharing options...
Psycho Posted November 9, 2006 Share Posted November 9, 2006 Well, for instance in this line where you are checking to see if you will set selected or not:[code]if (($Data['province_id']==$Rw['Province_ID']) || ($Rw['Province_ID']==$ProvinceID))[/code]I am assuming the $Data array is obtained by the z3.php page that is included at the top of the page - otehrwise I don't know where the $Data array is coming from.Then the $ProvinceID NEVER has a value so why are you including it in the function? You set $ProvinceID to NULL in the function head if no 2nd paramter is passed to the function and you have no calls to the function with a 2nd parameter.So, you need to ensure you are passing the proper data to the function so that it is checked against that conditional. Link to comment https://forums.phpfreaks.com/topic/26667-how-to-retain-dropdown-list-value/#findComment-122193 Share on other sites More sharing options...
mypopy Posted November 10, 2006 Author Share Posted November 10, 2006 z3.php is the function that connects to database. Link to comment https://forums.phpfreaks.com/topic/26667-how-to-retain-dropdown-list-value/#findComment-122525 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.