html
-
Open weblinks in external browser when using Phonegap
To prevent a Phonegap-wrapped app from opening external links in the apps webview, use javascript to open the link in the external browser. This works on Android (probably other platforms as well) [html]<a href="#" data-rel="external" target="_blank" onclick="window.open(‘http://www.jymden.com’, ‘_system’)">Jymden</a>[/html]
-
(PHP) Simple e-mail contact form.
A simple contact form, just for reference. Will add more info later on… [php] <?php if (isset($_POST[‘submit’])) { $name = $_POST[‘name’]; //name of sender $email = $_POST[’email’]; //e-mail of sender $email = stripslashes($email); $subject = $_POST[‘subject’]; //e-mail subject $subject = str_replace(array("\r\n","\r","\n"), "", $subject); //remove any linebreaks to keep from code injections $message = $_POST[‘message’]; //…
-
Hide elements with radio buttons
Sometimes you want to show or hide certain elements of a form, depending on the selection of a radiobutton. I am by no means any javascript ninja, but this is one simple way I came up with: This could apply to any element. For example, you could put a whole bunch of elements in…
-
Hide elements with checkbox
This is a slightly edited version of this post. Just to make it work with a checkbox instead of radio buttons. [html] <html> <head> <script type="text/javascript"> function DisplayElement(checked) { if (checked) { document.getElementById(‘text’).style.display = ”; } else { document.getElementById(‘text’).style.display = ‘none’; } } </script> </head> <body> <form name="form"> <input type="checkbox" onclick="DisplayElement(this.checked)" checked/> <input…