Cai Posted November 21, 2013 Share Posted November 21, 2013 here is my code: <input type="radio" name="SearchIDItem" value="Dept">Department <input type="radio" name="SearchIDItem" value="CatItem">Category Item <input type="radio" name="SearchIDItem" value="OfficeSupplies">Office Supplies if i click "Department" it will echo a Department same also with other radio button. Thanks a lot. Link to comment https://forums.phpfreaks.com/topic/284125-how-to-pass-variable-using-radio-button-without-submit-button/ Share on other sites More sharing options...
.josh Posted November 21, 2013 Share Posted November 21, 2013 be more specific.. is the value a static value you want to show? Or is it pulled from a database or what? Link to comment https://forums.phpfreaks.com/topic/284125-how-to-pass-variable-using-radio-button-without-submit-button/#findComment-1459305 Share on other sites More sharing options...
Cai Posted November 21, 2013 Author Share Posted November 21, 2013 it is a static value to query on my database. if i choose Department i will query data on my table Department and pass it on a combobox in html. Link to comment https://forums.phpfreaks.com/topic/284125-how-to-pass-variable-using-radio-button-without-submit-button/#findComment-1459306 Share on other sites More sharing options...
.josh Posted November 21, 2013 Share Posted November 21, 2013 Okay, well basically you want to add a click event listener that invokes an AJAX call onclick. The AJAX call should make a request to a controller script that queries your database based on the value and returns results. Then in the AJAX response callback, do something with the results. This is essentially a basic AJAX tutorial scenario, literally thousands of tuts for it out there. Look one up and if you get stuck on something in particular, feel free to post a specific question. Link to comment https://forums.phpfreaks.com/topic/284125-how-to-pass-variable-using-radio-button-without-submit-button/#findComment-1459310 Share on other sites More sharing options...
Cai Posted November 21, 2013 Author Share Posted November 21, 2013 Ah..so it is ajax function..thanks a bunch for the reply and explanation.. Link to comment https://forums.phpfreaks.com/topic/284125-how-to-pass-variable-using-radio-button-without-submit-button/#findComment-1459311 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.