Results 1 to 3 of 3

Thread: Radio buttons on mesage box

  1. #1

    Default Radio buttons on mesage box

    Hi,
    On submit of my form I want to show a 'Confirm Alert' on which user will be asked to choose option from 3 Radio button options , the selected options value should go as parameter with form submit..I've tried the examples which have option for text box (prompt & multiple line prompt) but didn't find any way for putting radio or checkbox on messagebox prompt...can anyone suggest the solution for the same?

    Also, Have noticed that a message box can have 4 buttons (ok,cancel,yes,no), is it possible to put any other buttons apart from these?...have seen the documentation which advises for change of button name for different locale ..but that is not the case i'm looking for..i am trying to put 2 different actions (not yes/no) on the message box..

    thanks in advance..

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    You can extend the message box or just create your own custom confirmation window, which is the least path of resistance for folks new to the framework and OO JS.

  3. #3

    Default

    Quote Originally Posted by kushal View Post
    Hi,
    On submit of my form I want to show a 'Confirm Alert' on which user will be asked to choose option from 3 Radio button options , the selected options value should go as parameter with form submit..I've tried the examples which have option for text box (prompt & multiple line prompt) but didn't find any way for putting radio or checkbox on messagebox prompt...can anyone suggest the solution for the same?

    Also, Have noticed that a message box can have 4 buttons (ok,cancel,yes,no), is it possible to put any other buttons apart from these?...have seen the documentation which advises for change of button name for different locale ..but that is not the case i'm looking for..i am trying to put 2 different actions (not yes/no) on the message box..

    thanks in advance..
    For my case, the simplest I came up w/ is this
    Code:
    Ext.Msg.show({
    	title: 'Confirm?',
    	msg: 'Please choose below.<br/><br/>' +
    		'<input type="radio" id="mb-option-ovr" name="mb-options" value="ovr" />' +
    		'<label for="mb-option-ovr">' +
    		'<b>Override</b>. Override explanation.' +
    		'</label><br/><br/>' +
    		'<input type="radio" id="mb-option-add" name="mb-options" value="add" />' +
    		'<label for="mb-option-add">' +
    		'<b>Additional</b>. Additional explanation' +
    		'</label>',
    	icon: Ext.MessageBox.QUESTION,
    	buttons: Ext.Msg.OKCANCEL,
    	fn: function(btn) {
    		if (btn == 'ok') {
    			var body = Ext.Msg.getDialog().body;
    			var ovr = body.select('input[id=mb-option-ovr]').elements;
    			var add = body.select('input[id=mb-option-add]').elements;
    			if (ovr.length > 0 && ovr[0].checked)
    				//override action/s here
    			else if (add.length > 0 && add[0].checked)
    				//additional action/s here
    			else {
    				//fallback code here
    				return;
    			}
    		}
    	}
    });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •