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 October 19th, 2004, 03:17 PM
Knuckle_Head Knuckle_Head is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Florida
Posts: 216 Knuckle_Head User rank is Sergeant (500 - 2000 Reputation Level)Knuckle_Head User rank is Sergeant (500 - 2000 Reputation Level)Knuckle_Head User rank is Sergeant (500 - 2000 Reputation Level)Knuckle_Head User rank is Sergeant (500 - 2000 Reputation Level)Knuckle_Head User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 1 h 49 m 46 sec
Reputation Power: 13
Unhappy Setting controls value with javascript block

Hello,

When I try to set the value of a control on a web form with
javascript i am unable to using this code....

Code:
 
jscript = "<script>"
jscript = jscript & "if (confirm('data changed, sure to continue?'))"
jscript = jscript & "{document.getElementbyID('textbox1').value='1';} "
jscript = jscript & "else"
jscript = jscript & "{self.close();}"
jscript = jscript & "</script>"
Page.RegisterClientScriptBlock(x, jscript)



my form id is form1. I have tried document.form1.textbox1.value='1'
among many other methods. This seems like it should be a very simple thing to do.
what am i missing here? Please help a java noobie

Reply With Quote
  #2  
Old October 20th, 2004, 09:42 AM
Yeruhn's Avatar
Yeruhn Yeruhn is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Netherlands
Posts: 428 Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level)Yeruhn User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 16 h 35 m 27 sec
Reputation Power: 10
document.form1.textbox1.value='1' should work.

Dunno what Page.RegisterClientScriptBlock(x, jscript) does...

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Setting controls value with javascript block


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 3 hosted by Hostway