i have a list output with unique names all under a.name
i would like to capture its unique text value, how would i write this?
heres the class i.NameCode:<html> <head> <script> $(document).ready(function() { $("#output a").click(function () { var name = $(".name").text();// outputs the first entry 'sample keyword 633379194 0' var prodid = $("#prodid").val(); $.post("class/i.Name.php", { name: name, prodid: prodid }, function(data){ $("#listColumn").html(data); }); }); </script> <title></title> </head> <body> <div id="output"> <ul> <li><a class="name" type="text" name="sample keyword 633379194 0">sample keyword 633379194 0</a></li> <li><a class="name" type="text" name="Red Herring 1">Red Herring 1</a></li> <li><a class="name" type="text" name="sample keyword 633379194 2">sample keyword 633379194 2</a></li> <li><a class="name" type="text" name="Red Herring 3">Red Herring 3</a></li> <li><a class="name" type="text" name="sample keyword 633379194 4">sample keyword 633379194 4</a></li> </ul> </div> <input name="prodid" id="prodid" type="hidden" value="<?php echo $prodid;?>" /> </body> </html>
heres the dB result, i want unique entriesCode:<? include_once('class.name.php'); include_once('class.db.php'); $name = $_POST['name']; $prodid = $_POST['prodid']; if ( $name == true) { $insertDB = new db; $insertDB->insertSQL = "INSERT INTO research VALUES ('$prodid', '$name')"; $insertDB->insert(); } ?>
![]()



Reply With Quote
Bookmarks