Wednesday, 28 August 2013

Retrieve data on textbox value dynamically

Retrieve data on textbox value dynamically

I don't know if this is possible but what I'm trying to accomplish is that
when ever I click this link
<a href=?name=$value1 id=$value1 class='txt_value'>Edit</a>
$value1 is a variable of my ID which i retrieved from my database.
my link could be
<a href=?name=$value1 id=$value1
<a href=?name=$value2 id=$value2
<a href=?name=$value3 id=$value3
etc..
my point is whenever I click any link above, a dialog box(jquery) would
appear and insert $value1 into a textbox inside the dialog box. Question
is, is it possible that whenever I click a link all data that is
associated with that ID (ex. first name, last name with ID #1 ) would also
be called and displayed into that dialog box.
this is my initial code
$(".bordered a").click(function(){
$(".ok").val($(this).attr("id"));
$(".create-modal").dialog({
height: 200,
modal:true,
width:300
});
});
<div class="create-modal">
<input class="ok" type="text">
</div>

No comments:

Post a Comment