Monday 15 February 2010

html - checking input type button pressed in php -


I'm beginning a lot for php, HTML and web development. Now i am learning php And I suspect that is similar to

but I did not find any suitable answer there. Please see the link above ... In fact the submission form is done using java script, which is why it has something like this in the button's onclique = "send (this.form)" ... ... and This button type is not 'stored', but this is the 'button' and I tried the answer that I got using print_r ($ _ POST). ) To print all the submitted values ​​.. But I could not find my button there.

My HTML code

  & lt; Form action = "user_register.php" method = "post" & gt; & Lt; Input type = "text" id = "txtEmail" name = "textEmail" /> & Lt; Input type = "button onclick = runjava () name =" button "/> gt;    

my javascript

  function runjava () ----- Code for verification and some animation document.forms.item (0). Submit ();}   

Please help me in this regard < / Div>

Yes, you can use jquery / javascript to do this.

Normally However, you should either assign

Assume that you have this input button:

  & quot; input type = "button "Id =" mybutt "Value =" click me ">   

to alerts when a button is clicked:

  $ (document) .ready (function () ($ ('# Mybutt'). (Function () (warning ('it was pressed');})}};   

$ ( Document) .ready (function () { bit ensures that the page has loaded all the elements before it, before the code allows binding events, etc. This is important.

Note that before you use the jQuery command, you must first ensure that the jQuery library is referenced / loaded on your page. Often we do this & lt; Head & gt; In tags, do this:

    

But this jQuery code can be loaded anytime before.

No comments:

Post a Comment