I'd do it like this:

<a href="DoSomethingIfJavascriptIsDisabled.html" class="positive
button" id="button_confirmAction" style="display: block;"
rel="confirmAction" title="Register">Click to register</a>

$(document).ready(function (){
        $('a.button').click(function (){
                $buttonAction = $(this).attr('rel');
                switch($buttonAction){
                        case 'confirmAction':
                                
$('#button_'+$buttonAction).css({display:'none'});
                                $('#button_back').css({display:'none'});
                                document.confirm.submit();
                                break;
                        case 'cancelAction':
                                alert('You have canceled');
                                break;
                        default:
                                return false;
                                break;
                }
                return false;
        });
});

Note the button class that provides the hook for the function. Also
it's good practice to provide a regular url in case the user has
disabled javascript.

On Feb 11, 11:18 pm, Josoroma <[EMAIL PROTECTED]> wrote:
> If i have the following button:
> <a href="javascript:{}" class="positive" id="button_confirmAction"
> style="display: block;" title="Register" onClick="valid()"; return
> false;" >
>
> The aobve button calls the next function:
>
> function confirmAction( action ) {
>
>         document.getElementById('button_' + action).style.display = 'none';
>         document.getElementById('button_back').style.display = 'none';
>         document.confirm.submit();
>
>         return false;
>
> }
>
> My super newbie question is?
> How do i can convert the function in Jquery?
>
> Thanks in advance.

Reply via email to