开发者

radio button clicking for payment process

hi guys presently am working with my own website.. my web site works fine i want to add something i开发者_StackOverflown my website. in payment process i have created 3 buttons, customers after fill that forms they need to choose the payment button three button will has a different values ie pounds £ 3 £ 5.5 and £ 9

.. once customer click the cart the payment amount will be automatically display on left side after that when customer clicking that radio button that payment amount should be added with that amount by clicking any one of radio button .. kindly check my website amd plz click unlock page

http://spsmobile.co.uk

plz can any one say the correct code which will be suitable with it..plz


If I'm getting you right, you want to show radio buttons that will, once clicked, show a defined value on the box at the right at your website (unlock page).

If that's so, you'll have to define radio buttons:

<input type="radio" name="" id="" value="1" onclick="showText(this)" />Text

Change name and id, add checked if you want it to be pre-checked; and modify the text that you want to add, before or after itself. Then, add an onclick event to load something like this:

        function showText(isList){
            txtIndex = isList.selectedIndex;
            document.getElementById('textDiv').innerHTML = nText[txtIndex];
        }

And add an array for that possible values;

        var nText = new Array()
        nText[1] = "";
        nText[2] = "";

Add as many arrays you need, and inside that inverted commas from each nText[] write what you want to show once each radio is selected. Once done that, you should print the textDiv (or whatever you want to), directly to the html page with <div id='textDiv'></div> or so.

That should make it, even thought you might have to change it slightly as I'm using this for <select> instead of direct inputs and onchange events instead of onclick, and I've changed it on-the-fly. Good luck.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜