HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 10th, 2005, 06:11 AM
snipered's Avatar
snipered snipered is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2005
Location: Birmingham, England
Posts: 909 snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 20 h 48 m 50 sec
Reputation Power: 11
Writing to a textbox using javascript.

How is it possible to write to a textbox within a form using javascript?

I have a onclick event that goes to my javascipt function, but i can't seem to write to a textbox.

Can anyone help please?

Reply With Quote
  #2  
Old January 10th, 2005, 07:53 AM
lewy's Avatar
lewy lewy is offline
Alter Ego Wizard
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Edinburg Tx
Posts: 4,381 lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 1009 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 1 Day 23 h 7 m 43 sec
Reputation Power: 1488
Use the following:
Code:
document.FormName.TextBoxName.value = "Whatever you Want to Write";

Where FormName is your form name and TextBoxName is the name of your textbox.

Reply With Quote
  #3  
Old January 10th, 2005, 08:19 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,628 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 h 23 m 57 sec
Reputation Power: 1902
or, to make it more standard:
Code:
document.forms["FormName"].elements["TextBoxName"].value = "Whatever you Want to Write";

Reply With Quote
  #4  
Old January 11th, 2005, 07:11 AM
klegrand klegrand is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Belgium
Posts: 72 klegrand User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 1 m 31 sec
Reputation Power: 5
Hi,
Can this also be used for a textbox on another doucument ? for example, the values excist on the default.asp file, but the textbox excist on sku.asp .

Thanks

Reply With Quote
  #5  
Old January 11th, 2005, 08:47 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,628 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 h 23 m 57 sec
Reputation Power: 1902
only if they're related as parent window-child window or parent window-frame inside parent. suppose default.asp is the parent, and sku.asp is opened as pop up window from within the parent. so this code in sku.asp will change value of textbox in default:
opener.document.forms["FormName"].elements["TextBoxName"].value = "i'm your child";
as you see, the keyword "opener" is used to access the parent.
if you have sku.asp as frame inside default.asp, then such code in sku.asp will change textbox inside the parent:
parent.document.forms["FormName"].elements["TextBoxName"].value = "you are my parent window";
here, the keyword is parent as you can see...

hope it make things more clear!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Writing to a textbox using javascript.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT