V Posted May 8, 2010 Share Posted May 8, 2010 I'm not sure if this qualifies as php. I'm working on contact form with required fields and I don't know how to change the labelText to the input value. I tried codes like +Value+ or +Xvalue+ but they don't work. Is it even possible to change it? :-\ part of the code is $('.requiredField').each(function() { if(jQuery.trim($(this).val()) == '') { var labelText = $(this).prev('label').text(); $(this).parent().append('<span class="error">You forgot to enter your '+labelText+'.</span>'); hasError = true; Link to comment https://forums.phpfreaks.com/topic/201075-labeltext/ Share on other sites More sharing options...
trq Posted May 8, 2010 Share Posted May 8, 2010 I'm not sure if this qualifies as php. Probably not considering its written in JavaScript. Link to comment https://forums.phpfreaks.com/topic/201075-labeltext/#findComment-1054930 Share on other sites More sharing options...
V Posted May 8, 2010 Author Share Posted May 8, 2010 oh ok, I wasn't sure. I'll inquire a javascript forum for this one. thanks Link to comment https://forums.phpfreaks.com/topic/201075-labeltext/#findComment-1055033 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.