I’m sending form to server and when I receive it back I need to access its elements
Here goes code.
some html
<here is the form>
<div style='border-style:solid' id='user_pic_n_1'></div>
and javascript
pic_type=($(this).attr('pic_type'));
pic_number=($(this).attr('pic_number'));
explanation : pic_type gets > user_pic and pic_number gets > 1
so the form is user_pic_form_n_1
$('#'+pic_type+'_form_n_'+pic_number).ajaxSubmit({
success: function(responseimage)
{
$('#'+pic_type+'_n_'+pic_number).html(responseimage);
now when the form gets into div, I need to get it’s inputs values.
please write code sample of how can I Access it
In my example i’m trying to get values by alert like this but probably I write with mistakes
alert($(\"#'+pic_type+'_form_n_'+pic_number+' input[name=error]\").val());
elements name is ‘error’ so I’m trying to get it from the form.
UPDATE
Here is HTML form which I get from AJAX
<form id='user_pic_form_n_1' name='user_pic_form_n_1' action='/serv/pic_processor.php' method='POST'>
<input type='hidden' name='error' value='456'/>
</form>
So when it gets from server into responseimage variable, I put that into Div and then I want to access this form and alert value of tag named ‘error’
You can pass the element contain the response html as a context along with selector.
Edit, based on comments
Live demo
Html
Javascript