Jump to content

update fields


doddsey_65

Recommended Posts

i have some javascript which should show the messages at the side of the input but they arent and i dont know where im going wrong.

 

<script language="javascript">
$(document).ready(function()
{
$("#fullname").blur(function()
{
//remove all the class add the messagebox classes and start fading
$("#msgbox1").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");
$.post("update.php",{ fullname:$(this).val() } ,function(data)
{
if (data==1)
{
$("#msgbox1").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Update Successful').addClass('messageboxerror').fadeTo(900,1);
});
}
else
{
$("#msgbox1").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Error Updating').addClass('messageboxerror').fadeTo(900,1);
});
}
});
});
});
</script>

 

<input class="input2" id="fullname" type="text" name="fullname" value="<?php echo $tab_info->user_real_name; ?>" />
<span id="msgbox1" style="display:none"></span>

 

ive used this before and it worked but not this time. ANyone know why?

Link to comment
https://forums.phpfreaks.com/topic/215991-update-fields/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.