Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fill another field, Javascript



This is just a guess, as I am not a JS expert. Stick it in a function in <SCRIPT> tags. then have onblur call "return function()" and see what it does.
--B
On Apr 3, 2008, at 8:26 PM, Robert Poland wrote:


Ben,

I altered it to use what works in a function and it still wouldn't work.

<input name="print_name" id="print_name" type="text" style="height: 25px; width: 400px;" value="print_name" size="8" maxlength="32" onblur="document.request_form.i_name.value = print_name.value" />

Guess I'll just go with the function.


On Apr 3, 2008, at 6:05 PM, Ben wrote:

That should work, if you want to alter the other field's value ONLY after the user has tabbed or clicked out of the field. If it doesn't work, try subbing print_name.value with this.value .

--B
On Apr 3, 2008, at 7:37 PM, Robert Poland wrote:

Hi,

Maybe I'm misunderstanding all the kind help here.

Should a line like this work or do I need to call a function?

<input name="print_name" id="print_name" type="text" style="height: 25px; width: 400px;" value="print_name" size="8" maxlength="32" onblur = "document.getElementById('i_name').value = print_name.value" />


On Apr 3, 2008, at 3:21 PM, John Jarrard wrote:

Hi Bob,
	Use an onkeyup or onblur event...

JJ


On Apr 3, 2008, at 3:20 PM, Robert Poland wrote:

Hi,

On a form I wish to fill field2 with a value I am typing into field1.

I realize I can do this with an onclick but isn't there a way to , for instance do it with onreturn?


Bob Poland - Fort Collins, CO



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden



Bob Poland - Fort Collins, CO



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden



Bob Poland - Fort Collins, CO




_______________________________________________ Do not post admin requests to the list. They will be ignored. Web-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden
References: 
 >Fill another field, Javascript (From: Robert Poland <email@hidden>)
 >Re: Fill another field, Javascript (From: Robert Poland <email@hidden>)
 >Re: Fill another field, Javascript (From: Ben <email@hidden>)
 >Re: Fill another field, Javascript (From: Robert Poland <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.