Search Results

Search found 11 results on 1 pages for 'superuntitled'.

Page 1/1 | 1 

  • PHP: parse $_FILES[] data in multidimesional array

    - by superUntitled
    Example form here: http://jsfiddle.net/superuntitled/uaTtx/1/ I have a form that allows for dynamic duplication of the form fields. The form allows for file uploads and text input, so the data is sent in both $_POST and $_FILES arrays. The the initial set of inputs look like this: <input type="text" name="question[1][text]" /> <input type="file" name="question[1][file]" /> <input type="text" class="a" name="answer[1][text][]" /> <input type="file" name="answer[1][file][]" /> When duplicated the fields are incremented, they look like this: <input type="text" name="question[2][text]" /> <input type="file" name="question[2][file]" /> <input type="text" class="a" name="answer[2][text][]" /> <input type="file" name="answer[2][file][]" /> To complicate matters, the "answer" form fields can also be duplicated (thus the [] at the end of the 'answer' name array. How can I parse the posted $_FILES array? I have tried something like this: foreach ($_FILES['question'] as $p_num) { echo $p_num['file']['name']; foreach ($_FILES['answer'] as $a_num) { echo $a_num['file']['name']; } } but I get an "Undefined index: file... " error. How can I parse out the posted values.

    Read the article

  • CSS - postion: absolute; - auto height

    - by superUntitled
    I am having a problem with some div's The outer div has a min-height, but the inner divs are all varying heights. Because the inner divs are absolute positioned, they do not affect the outer divs height. Is there a way to make these inner divs affect the height of the outer div? The reason I am styling these divs with position:absolute is so that they all start at the top of the container div.

    Read the article

  • Reset variable in javascrtp (jQuery)

    - by superUntitled
    I am trying to reset a variable (that updates the src value for an image) when an area of an image map is clicked, so that the hover function calls a different image when the user hovers over another area in the image map. I have a variable called "state" that I set right off the bat. This is the variable that I want to reset when an area is clicked. var state = "path/to/images/feed1.png"; I have a couple of functions involving hover() and click(). $("#Map area").click( function () { var button = $(this).attr("id"); // here is where i want to reset the 'state' variable var state = "path/to/images/" + button + ".png"; alert("you clicked "+button+" hello"); return false; } ); $("#Map area").hover( function () { var button = $(this).attr("id"); over("path/to/images/" + button + ".png"); }, function () { off(); }); And some functions that these functions call: function over(image) { $("#feednavImg").attr("src", image); } function off() { $("#feednavImg").attr("src", state); }

    Read the article

  • php: sort and count instances of words in a given string

    - by superUntitled
    Hello, I need help sorting and counting instances of the words in a string. Lets say I have a collection on words: happy beautiful happy lines pear gin happy lines rock happy lines pear How could I use php to count each instance of every word in the string and output it in a loop: There are $count instances of $word So that the above loop would output: There are 4 instances of happy. There are 3 instances of lines. There are 2 instances of gin.... Thank you for your genius.

    Read the article

  • jQuery: bind generated elements

    - by superUntitled
    Hello, thank you for taking time to look at this. I am trying to code my very first jQuery plugin and have run into my first problem. The plugin is called like this <div id="kneel"></div> <script type="text/javascript"> $("#kneel").zod(1, { }); </script> It takes the first option (integer), and returns html content that is dynamically generated by php. The content that is generated needs to be bound by a variety of functions (such as disabling form buttons and click events that return ajax data. The plugin looks like this (I have included the whole plugin in case that matters)... (function( $ ){ $.fn.zod = function(id, options ) { var settings = { 'next_button_text': 'Next', 'submit_button_text': 'Submit' }; return this.each(function() { if ( options ) { $.extend( settings, options ); } // variables var obj = $(this); /* these functions contain html elements that are generated by the get() function below */ // disable some buttons $('div.bario').children('.button').attr('disabled', true); // once an option is selected, enable the button $('input[type="radio"]').live('click', function(e) { $('div.bario').children('.button').attr('disabled', false); }) // when a button is clicked, return some data $('.button').bind('click', function(e) { e.preventDefault(); $.getJSON('/returnSomeData.php, function(data) { $('.text').html('<p>Hello: ' + data + '</p>'); }); // generate content, this is the content that needs binding... $.get('http://example.com/script.php?id='+id, function(data) { $(obj).html(data); }); }); }; })( jQuery ); The problem I am having is that the functions created to run on generated content are not binding to the generated content. How do I bind the content created by the get() function?

    Read the article

  • Left floated element and unordered lists (ul).

    - by superUntitled
    Hello, I am trying to indent the li elements of a ul. There is a left floated div with an image in it. The li element will indent only if I add left padding that is wider than the image itself. I you would like to look at a version irl, take a look. On this page, I have given the li a background color to demonstrate. <div class="left"> <p ><img src='image.jpg' alt='homepage.jpg' width="360" height="395" /></p> </div> <p> Est tincidunt doming iis nobis nibh. Ullamcorper eorum elit lius me delenit. </p> <hr /> <h3>Lorem</h3> <ul> <li>list element</li> <li>list element</li> <li>list element</li> </ul> The css: .left {float: left; } .left img {padding-right: 20px;} ul li { padding-left: 10px; background: blue; } thanks!

    Read the article

  • PHP: parse $_FILES[] data in multidimesional array

    - by superUntitled
    I having been looking around for an answer to this and have not found an answer anywhere, I am hoping someone has done this before! I have a form that allows for dynamic duplication of the form fields. The form allows for file uploads and text input, so the data is sent in both $_POST and $_FILES arrays. The the initial set of inputs look like this: <input type="text" name="primary[1][text]" /> <input type="file" name="primary[1][file]" /> <input type="text" class="a" name="secondary[1][text][]" /> <input type="file" name="secondary[1][file][]" /> When duplicated the fields are incremented, they look like this: <input type="text" name="primary[2][text]" /> <input type="file" name="primary[2][file]" /> <input type="text" class="a" name="secondary[2][text][]" /> <input type="file" name="secondary[2][file][]" /> To complicate matters, the "secondary" form fields can also be duplicated (thus the [] at the end of the secondary name array. How can I parse the posted $_FILES array? I have tried something like this: foreach ($_FILES['question'] as $f_num) { echo $f['file']['name']; } but I get an "Undefined index: file... " error.

    Read the article

  • Ajax: Partial refresh of a parent page (update a div) from "lightbox" window

    - by superUntitled
    Is there a way to update information in a div of a parent page from a pop-up/"lightbox" window. I would like to create a pop up window that contains a form that updates a database (currently i am using php/mysql with prototype). In other words... I would like a user to be able to use a form in a popup window to update the database, and the changes that are made to be shown on the parent page without that parent page being refreshed. Thanks.

    Read the article

  • jQuery: Post form to a modal window for previewing the entered data

    - by superUntitled
    I am looking for a way to use jQuery to allow a user to look at a modal window "preview" of a form before they submit the form to be saved. I have this working with javascript, the form is posted to a file named preview.php that iterates through the posted information. The script currently opens a new window. I would like instead to use jQuery to post the form to a modal window for previewing. Does anyone have any thoughts on how to do this? This is what I am currently using: <script language="JavaScript"> function preview(form) { form.target='_blank'; form.action='http://example.com/preview.php'; form.submit(); } </script> <input type="button" value="preview" onclick='preview(this.form)'>

    Read the article

  • jQuery: click function exlude children.

    - by superUntitled
    Trying to wrap my head around the jQuery ".not()" function, and running into a problem. I would like to have the parent div to be "clickable" but if a user clicks on a child element, the script is not called. $(this).not(children()).click(function(){ $(".example").fadeOut("fast"); }); the html: <div class="example"> <div> <p>This content is not affected by clicks.</p> </div> </div>

    Read the article

  • wordpress: previous_post_link() / next_post_link() placeholder

    - by superUntitled
    I am having trouble with the previous_post_link() and next_post_link() functionality. When there is no previous post, the function previous_post_link() does not display a link, likewise for the next_post_link() and the last post. I would like to have a placeholder image so that the design stays consistent. Currently I have images of green arrows pointing left and right, I would like to place an image of a grey arrow if there are no more posts to go back to. Is there a way to use the next_post_link()/previous_post_link() functions but not have the link removed. I also wonder if there is a way for the links to cycle, so that if you come to the most recent post, the next post link would bring you back to the first post.

    Read the article

1