June 28, 201214 yr How to submit forms with onClick <a href="#" onClick="document.getElementById('ContactForm').submit()">Send</a> I ask you please some guidance. As I have not found elucidative literature I made up my mind to post. How to pass variables with data to my php script ?? <form method="POST" name="form" id="form" class="form-1" action=""> Thank you for your attention. Edited June 29, 201214 yr by Renaissance-Design Please use the code button or tags to format your code.
June 29, 201214 yr Inline event handlers are not good practice. Give your form a RESTful target and prevent default handling with a Javascript event listener. If the method is POST, the variables will be available in the $_POST superglobal.
June 29, 201214 yr Author So how to keep the neat aspect of the button and submit the form ; If I can´t format with css the <input name="send" type="submit" class="button" id="send" value="" /> to appear exactly as a <a href...... class=""....
June 29, 201214 yr So how to keep the neat aspect of the button and submit the form ; If I can´t format with css the <input name="send" type="submit" class="button" id="send" value="" /> to appear exactly as a <a href...... class="".... You can. Either use the attribute selector: input[type=submit] { } or just give it a class.
June 29, 201214 yr Author You can. Either use the attribute selector: input[type=submit] { } or just give it a class. It works fine. If I want to add hover function then I will need a js script I suppose ? Thank you for your help.
June 29, 201214 yr Author input[type=reset] { } is there a way to make it work with <input type="reset" name="reset" ...... ?
July 4, 201214 yr input[type=reset] { } is there a way to make it work with <input type="reset" name="reset" ...... ? input[name="reset"] { }
Create an account or sign in to comment