jester626 Posted May 27, 2007 Share Posted May 27, 2007 I am hacking a lookup script that when I enter in the club member ID number it places the member's info into a field. The script works just fine when populating simple text fields, however I have one field called status that I want to use a drop down menu. basically I want the dropdown to display the members current membership status but be able to select other status levels if we need to. The form element on lookup.php looks like this Membership Status: <select name="membershipstatus" id="membershipstatus"> </select> and the query page getmember.php) looks like this echo "formObj.membershipstatus.value = '".$inf["membershipstatus"]."';\n"; any help on how to tie these two together would be greatly appreciated. Jester Quote Link to comment Share on other sites More sharing options...
jester626 Posted May 27, 2007 Author Share Posted May 27, 2007 Still stuck on this one, Ideas anyone? Thanks Quote Link to comment Share on other sites More sharing options...
brissy_matty Posted June 1, 2007 Share Posted June 1, 2007 I am not sure if this will help you but i achieved population of my drop downs via the following: On my form page the select was displayed as normal the key being the onchange event for me - when the on change executes it jumps to the function that tells it to run the php page which returns the result -- in my useage i had three drop downs one based upon another - the initial just loading values from a mysql table. <select name="example" id="example" onchange="getexample(this)"> <option value="">Select</option> </select> this is the getexample() function (well a stripped back version) function getday(sel) { var cday = sel.options[sel.selectedIndex].value; ajax.requestFile = 'getdays.php?cday='+cday; ajax.onCompletion = createday; ajax.runAJAX(); }} the creatday function below: function createday() { var obj = document.getElementById(day'); eval(ajax.response); } Hope that helps i haven't tested this stripped back version but it might give you a little help... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.