[UPHPU] Another javascript question, with some css and ajax thrown in for fun.

John David Anderson uphpu at johndavidanderson.net
Mon Apr 30 16:01:40 MDT 2007


On Apr 30, 2007, at 3:57 PM, Ash wrote:

> Is there a way to dynamically update one part of an html page with  
> the data entered into a form on the same page? I have a page that  
> has a form on the left hand side of the page, and a graphics on the  
> right hand side of the page. I need to update the text that is on  
> top of the graphic (in a text box) with the data that is input on  
> the left-hand form, as soon as the person leaves that field. ( I'm  
> not going to use gd or anything like that to update the graphic  
> itself. I just want to update the text on top of the graphic.)
>
> For example, The form looks kinda like this:
>                                          
> ________________________________________________
> First name _______                       
> |                                               |
> Last name _______                       |    Image with text boxes  
> on top goes here      |
> Phone Number ______                     | 
> ________________________________________________|
>
> And as soon as they put their First name in and go to the Last name  
> field, the text box on top of the image on the right side of the  
> page instantly puts the text they entered on the form.

This is what it might look like using prototype:

Event.observe('first_name_form', 'blur', function(event) {
	$('first_name_image').value = $('first_name_form').value;
});

Where first_name_form is the ID of the form element on the left, and  
first_name_image is the ID of the element over the image on the right.

-- John

>
> Ash
>
> _______________________________________________
>
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
>



More information about the UPHPU mailing list