Saturday, January 21, 2012

Javascript: How to Get input array values in JQuery

If you have stored array values in an input box using PHP and try to retrieve those array values using JQuery then use the following format,


    $("input[name^=ar]").each(function() {   //remove id attribute of an input box and replace it with name attribute

        alert($(this).val());

    });


Input box values will be like,
<?php

    for($y=1;$y<sizeof($arr);$y++){

  echo "<input type=text name=ar[] value='$arr[$y]'></input>"; 

    }

  ?>




Question & Answer Forum

Q: do know how to change the GRUB Menu Timeout On Ubuntu?(by caroline, US)
http://computgozez.blogspot.com.es/p/question-answer-forum.html


submitted by guest blogger
 rajk , India
Retweet this story

No comments:

Post a Comment