p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 20th, 2005, 08:49 PM
Registered User
Points: 10, Level: 1
Points: 10, Level: 1 Points: 10, Level: 1 Points: 10, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.NET custom controls


anyone seen any good articles on OnPreRender

the javascript

i have created a custom validation control to check wither a user either ticks a checkbox or enters text in a textbox

server side is fine

got an extra property to take in the name of the second control to validate


i have this code which does actually do the job

  sb_Script.Append( "var val = document.all[document.all[\"" );
    sb_Script.Append( this.ID );
    sb_Script.Append( "\"].controltovalidate];" );
    sb_Script.Append( "\r" );
    sb_Script.Append( "var col = val.all;" );
    sb_Script.Append( "\r" );
    sb_Script.Append( "if ( col != null ) {" );
    sb_Script.Append( "\r" );
    sb_Script.Append( "for ( i = 0; i < col.length; i++ ) {" );
    sb_Script.Append( "\r" );
    sb_Script.Append( "if (col.item(i).tagName == \"INPUT\") {" );
    sb_Script.Append( "\r" );
    sb_Script.Append( "if ( col.item(i).checked ) {" );
    sb_Script.Append( "\r" );
    sb_Script.Append( "\r" );
    sb_Script.Append( "return true;" );


however its not very neat

what are the new rules for getting an object into javascript

while since i've used javascript but i think you used to be able to do

var chbox1 = document.form1.checkbox1

then access the properties of chbox1

any one know of any good what asp.net has done to javascript articles?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
  #2 (permalink)  
Old January 20th, 2005, 11:42 PM
Friend of Wrox
Points: 5,604, Level: 31
Points: 5,604, Level: 31 Points: 5,604, Level: 31 Points: 5,604, Level: 31
Activity: 40%
Activity: 40% Activity: 40% Activity: 40%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,666
Thanks: 6
Thanked 9 Times in 9 Posts
Send a message via AIM to mat41
Default

.NET? - This is the classic ASP area

Anyhow, here is JS function that checks: is it checked or uncheked

function chqBoxState(oneelement)
{
   var status = 'unChecked';
   if (oneelement.checked)
   {
      status = 'checked';
      alert('You have ' + status + ' the checkbox ');
   }
   else
   {
      alert('You have ' + status + ' the checkbox);
   }

}

Wind is your friend
Matt
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Design-Time Debugging of ASP.NET Custom Controls robzyc ASP.NET 2.0 Basics 0 July 2nd, 2008 07:29 AM
Custom HTTP 404 Problem w/ASP to ASP.NET kwilliams ASP.NET 2.0 Professional 7 November 26th, 2007 04:17 PM
asp.net 2 custom membership provider andyw ASP.NET 2.0 Professional 24 September 6th, 2006 09:31 AM
HTTP custom handler in ASP.NET pbhupal ASP.NET 1.1 0 March 17th, 2005 01:48 PM
Custom Icon for ASP.NET Control bmains ASP.NET 2.0 Basics 0 September 22nd, 2004 06:09 PM



All times are GMT -4. The time now is 11:14 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc