how to add/remove input field dynamically

JAVASCRIPT $(document).ready(function() { var max_fields = 10; //maximum input boxes allowed var wrapper = $(“.input_fields_wrap”); //Fields wrapper var add_button = $(“.add_field_button”); //Add button ID var x = 1; //initlal text box count $(add_button).click(function(e){ //on add input button click e.preventDefault(); if(x < max_fields){ //max input box allowed x++; //text box increment $(wrapper).append(‘<div><input type=”text” name=”mytext[]”/><a href=”#” class=”remove_field”>Remove</a></div>’); … Read more

how to change second drop down list on change of first drop down list option

HTML <select name=”select11″ id=”select11″> <option value=”1″>Fruits</option> <option value=”2″>Animals</option> <option value=”3″>Birds</option> <option value=”4″>Cars</option> </select> <select name=”select12″ id=”select12″> <option value=”1″>Litchi</option> <option value=”1″>Mango</option> <option value=”1″>Orange</option> <option value=”2″>Lion</option> <option value=”2″>Fox</option> <option value=”2″>Bear</option> <option value=”3″>Parrot</option> <option value=”3″>Hawk</option> <option value=”4″>Maruti</option> </select> JAVASCRIPT $(“#select11”).change(function() { if($(this).data(‘options’) == undefined){ /*Taking an array of all options-2 and kind of embedding it on the select1*/ … Read more

how to calculate value of two textfield and display its sum in third textfield autmotatically

hi,friends i want to show the trick of how to calculate the value of two text-field and got its sum in third text-field automatically and show sum when we type some value in second text-field. JAVASCRIPT <script> function sum() { var txtFirstNumberValue = document.getElementById(‘txt1’).value; var txtSecondNumberValue = document.getElementById(‘txt2’).value; var result = parseInt(txtFirstNumberValue) + parseInt(txtSecondNumberValue); if (!isNaN(result)) … Read more

a insert query in wordpress

We can use insert query in wordpress as follows.Just take a look on query.It is quite simple as we use in php to insert data into database. <?php global $wpdb; $wpdb->prepare( “INSERT INTO `wp_submitted_form` (`name`,`email`,`phone`,`country`,`course`,`message`,`datesent`) values (‘$name’, ‘$email’, ‘$phone’, ‘$country’, ‘$course’, ‘$message’, ‘$datesent’)” ); ?> Or, use can use query in this way also <?php … Read more

how to create html5 audio player

hi guys i would like to tell you that you can use audio player in your webpage to play an audio sound using html5,css3 and jquery. To play an audio in website you can use audio tag of html5.In this demo player i have added functionality of html ,css and javascript to play an audio.