Talon21 Posted March 18, 2009 Share Posted March 18, 2009 Hi, I have the following select fields: <label for="insurancePolicy">בחר את סוג הביטוח:</label> <select name='insurancePolicy' style="width:154px;"> <option>בחר את סוג הביטוח</option> <option value='1' name='ביטוח דירה'></option> <option value='2' name='ביטוח נסיעות'>ביטוח נסיעות</option> <option value='3' name='ביטוח בריאות'>ביטוח בריאות</option> <option value='4' name='ביטוח רכב'>ביטוח רכב</option> </select> And I want when the user select value='ביטוח רכב' he will redirect to a diffrent page. How can I do that? Thanks in Advance Link to comment https://forums.phpfreaks.com/topic/149957-re-direct-when-select/ Share on other sites More sharing options...
irkevin Posted March 18, 2009 Share Posted March 18, 2009 You might want to use javascript for that. Just google for Javascript DropDown Navigation Link to comment https://forums.phpfreaks.com/topic/149957-re-direct-when-select/#findComment-787564 Share on other sites More sharing options...
Festy Posted March 18, 2009 Share Posted March 18, 2009 In the onclick event of your dropdown, call a javascript function. In that function use document.location = 'your url' to redirect to a different page. Tell me if it works. Link to comment https://forums.phpfreaks.com/topic/149957-re-direct-when-select/#findComment-787571 Share on other sites More sharing options...
Talon21 Posted March 18, 2009 Author Share Posted March 18, 2009 In the onclick event of your dropdown, call a javascript function. In that function use document.location = 'your url' to redirect to a different page. Tell me if it works. thank you can you please send me an example code Link to comment https://forums.phpfreaks.com/topic/149957-re-direct-when-select/#findComment-787579 Share on other sites More sharing options...
syed Posted March 18, 2009 Share Posted March 18, 2009 Example. <select> <option onclick="document.location='http://www.google.com'">Google</option> <option onclick="document.location='http://www.msn.com'">MSN</option> <option onclick="document.location='http://www.yahoo.com'">Yahoo</option> </select> Link to comment https://forums.phpfreaks.com/topic/149957-re-direct-when-select/#findComment-787583 Share on other sites More sharing options...
Talon21 Posted March 18, 2009 Author Share Posted March 18, 2009 Thank you very much problem fixed I used this one: <option onclick="document.location='http://www.yahoo.com'">Yahoo</option> Thanks Again. Link to comment https://forums.phpfreaks.com/topic/149957-re-direct-when-select/#findComment-787966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.