dardime Posted November 19, 2015 Share Posted November 19, 2015 Hi i need help in adding a checkbox saying I AGREE on my popup. Thank you in advance. Here is my code below: $('#working_days').change(function(){ if($(this).val()=="2 to 3"){ alert("Please inform the customer that the time starts once the job has been assigned to the technician. If this Job is assigned after 3pm the timeframe starts from the next working day") } else if($(this).val()=="3 to 5"){ alert("Please inform the customer that the time starts once the job has been assigned to the technician. If this Job is assigned after 3pm the timeframe starts from the next working day") } else if($(this).val()=="5 to 7"){ alert("Please inform the customer that the time starts once the job has been assigned to the technician. If this Job is assigned after 3pm the timeframe starts from the next working day") } else if($(this).val()=="Others"){ alert("Please inform the customer that the time starts once the job has been assigned to the technician. If this Job is assigned after 3pm the timeframe starts from the next working day") } }) <select name="working_days" id="working_days" class="requiredField"> <option value="">Select working days</option> <option value='2 to 3'>2 to 3</option> <option value='3 to 5'>3 to 5</option> <option value='5 to 7'>5 to 7</option> <option value='Others'>Others</option> </select> Quote Link to comment https://forums.phpfreaks.com/topic/299516-adding-checkbox-i-agree-on-popup/ Share on other sites More sharing options...
Psycho Posted November 19, 2015 Share Posted November 19, 2015 JavaScript alerts do not have the ability to add checkboxes or other fields. You can use something like a JQueryUI dialog: https://jqueryui.com/dialog/#modal-form Quote Link to comment https://forums.phpfreaks.com/topic/299516-adding-checkbox-i-agree-on-popup/#findComment-1526711 Share on other sites More sharing options...
mikesta707 Posted December 3, 2015 Share Posted December 3, 2015 If you don't want to use a plugin (though a plugin like psycho suggested look much nicer and have much more capabilities) You can use a javascript confirm box: http://www.w3schools.com/jsref/met_win_confirm.asp IE: var txt; var r = confirm("Agree or Disagree!"); if (r == true) { txt = "You Agreed!"; } else { txt = "You Disagreed!"; } Quote Link to comment https://forums.phpfreaks.com/topic/299516-adding-checkbox-i-agree-on-popup/#findComment-1527509 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.