Search the Community
Showing results for tags 'input'.
-
Hi, I am having a small issue with a front end html form, which through a series of looped input fields will update multiple WordPress posts at once, on submisson. The issue i'm having currently, is on submission it's only updating 1 post. I have found a solution to my problem, here: http://wordpress.stackexchange.com/questions/206372/how-to-handle-dynamic-form-data-with-repeating-fields But as i am still a bit of a novice, I have tried to apply the max_id solution to my code below, so far i've not got it to work. Using the solution on the above link, I don't suppose someone could show/tell me, what the code should be in it's entirety?? Including the foreach section, thanks! foreach( $testArray as $value ) { $post_information = array( 'post_title' => $value, 'post_status' => 'publish', // Choose: publish, preview, future, draft, etc. 'post_type' => 'predictions' //'post',page' or use a custom post type if you want to ); //update post wp_update_post($post_information);
-
I've got an HTML 5 date input box working on my site. Anyone know how to make the whole thing selectable like a drop down (select) box? Currently you can only select it by clicking on the arrow at the far right of it. I don't mind about losing the cross or up and down arrows. I just want the field to be fully selectable like a drop down box. Any ideas please? Thanks.
-
You know when you type text into a form input and it automatically types the same text in another div? Well I am trying to do the same thing but instead show the same text value from the div 1 to div 2. Here is my code. It works with the input text field but not with the textarea. Can you tell me why? <input type="text" name="title" id="title" value="" maxlength="55" /> <textarea name="details" id="details" value="" maxlength="160" ></textarea> <!-- Values show up in these inputs --> <input type="text" name="seo_page_title" id="seo_page_title" value="" maxlength="55" /> <textarea name="seo_page_description" id="seo_page_description" maxlength="160" ></textarea> <script> $('#title').on("input", function() { var dInput = this.value; console.log(dInput); $('#seo_page_title').val(dInput); }); $('#details').on("input", function() { var dInput = this.value; console.log(dInput); $('#seo_page_description').val(dInput); }); </script>
-
I succeed to create the vertical data, but I just add checkbox in data table in PHP. I know how to set up the value in checkbox, but i can't figure how to put name and value that from database. for example, when you can see name list in columns, you click checkbox that which has name that selected data from database. here example in code: I can get value from outside of php in html: <input type="checkbox" name="???" value="<?php echo $data['Name'] ?>"> But I can't figure to set up the value that inside php: echo "<tr><td><input type="checkbox" name="???" value=?></td></tr>"; my point is I can use echo to print, but echo is used already, php cannot take two name code in same time, same line number. Can you help? If you want to see my full code in php, Let me know...I will put my code in next comment in this thread. Thank you so much! Gary Taylor
-
I have a form that updates a total based on the fields values entered on a form when the user leaves each field. This works fine but I also want to update one of the entry fields which is a percentage of another. I have in my js var theForm = document.forms[frm]; var eTotal = theForm.elements["Total"]; var ePremium = theForm.elements["Premium"]; if (eTotal.value > 0) { var PremAmount = parseFloat(eTotal.value * ePremium.value / 100); } var divobj = document.getElementById('PremAmount'); divobj.innerHTML = PremAmount.toFixed(2); Which is called with onblur="addPrem('totals')" The original value in the totals field from the MySQL table is 770.00 This produces the following html page <input name="PremAmount" tabindex="1" class="ent" id="PremAmount" size="2" value="77.00"> When I change the total to 888.00 I get the following <input name="PremAmount" tabindex="1" class="ent" id="PremAmount" size="2" value="77.00">88.80</input> So it looks like it's working but writing a div rather than into the field itself Can anyone help me with this please