hi,
check this one. very basic javascript.
<p>Street Number:<input type='text' name='txtStreetNumber'
value='$streetnumber' size='20'
onchange="if(this.value!='<?=$streetnumber?>')
document.getElementById('chnge').style.display=''; else
document.getElementById('chnge').style.display='none';"> <span id="chnge"
style="display:none;">VALUE CHANGED</span>
regards,
shahu.
On Tue, Mar 23, 2010 at 8:50 PM, Grant <[email protected]> wrote:
> Hello,
>
> How do I read the value from an edited input text? I know how to make the
> text input retrieve the value from a Mysql database.
>
> <p>Street Number:<input type='text' name='txtStreetNumber'
> value='$streetnumber' size='20' onfocus='changeColorOnFocus(this)'
> onblur='changeColorOffFocus(this)'></p>
>
> This would display a text field such as:
> Street Number: [ Text box is here]
>
> However, how can my form identify when the text input has been altered? I
> believe this is considered a "dirty" event. My goal is to print a short
> message next to the text box that says "Value changed" so that the user can
> know which fields were changed BEFORE he hits submit to run the Update
> query. This would allow any mistakes to be canceled. Ideally, I'd like some
> some of event to also identify when a form was changed and not saved BEFORE
> leaving the current page.
>
> For example:
> Street Number; [Text box is here] "Value changed!"
>
> I simply want to use an If Statement to compare the current value to the
> new
> value.
>
> if (txtStreetNumber != ????????)
> { echo "Value changed";}
>
> I found javascript online, but none of it seems to work. I also tried the
> "onchange" event since it can recognize when a field is changed and loses
> focus. But that also does not seem to work, and I've never used this event
> before.
>
> Thanks,
> Grant
>
> On Fri, Mar 19, 2010 at 6:21 AM, webmaster_bmw <
> [email protected]
> > wrote:
>
> >
> >
> > No posts since October 2009....
> >
> > Anyone out there?
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> The php_mysql group is dedicated to learn more about the PHP/MySQL web
> database possibilities through group learning. Yahoo! Groups Links
>
>
>
>
--
http://phpinterviewanswers.blogspot.com/
[Non-text portions of this message have been removed]