Skip to content Skip to sidebar Skip to footer

A Onclick Event Opens Box And On Box Submit It Links To Php Function Which Set Some Values To Db

I'm trying to create sort of alert box with an onClick event. The basic idea here is to create box which asks the user to select some value (checkbox) and then submit. After user c

Solution 1:

you have to use javascript and ajax methods .. you cant call php functions in you html like the on submit ... you can call javascript function and that function will call ajax request to call a php function ....

html is on client side , php is on the server side . you can communicate between then using javascript if you want .

Solution 2:

You can try this...

<scripttype='text/javascript'>functionbox(){

                document.getElementById('light').style.display='block';
                document.getElementById('fade').style.display='block';
        }

</script><style>.black_overlay{
            display: none;
            position: absolute;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            background-color: black;
            z-index:1001;
            -moz-opacity: 0.8;
            opacity:.80;
            filter: alpha(opacity=80);
        }
        .white_content {
            display: none;
            position: absolute;
            top: 25%;
            left: 30%;
            width: 30%;
            height: 19%;
            padding: 8px;
            border: 8px solid #a31d21;
            background-color: white;
            z-index:1002;
            overflow: auto;

        }
    </style>

And the body...

<ahref="#"onclick="box();">Click</a><divid="light"class="white_content">

 Your form here...      

  </div><divid="fade"class="black_overlay"></div>

Post a Comment for "A Onclick Event Opens Box And On Box Submit It Links To Php Function Which Set Some Values To Db"