Current location: Hot Scripts Forums » General Web Coding » JavaScript » Toggle button and show next


Toggle button and show next

Reply
  #1 (permalink)  
Old 03-27-08, 09:05 AM
Rapid Dr3am Rapid Dr3am is offline
Community VIP
 
Join Date: Jan 2004
Location: Liverpool, England
Posts: 752
Thanks: 0
Thanked 0 Times in 0 Posts
Toggle button and show next

Hi looking for a little advice here.

What I have is a setup like this:

Surname | Forename | Telephone | Mobile
Email | Comments

What I want is like this

Surname | Forename | Telephone | Mobile
----------------------------------------
Email | Comments
----------------------------------------

With a toggle button so when I click it, it posts back and then shows or hides the Email | Comments boxes.

The other one I want to do is, I'm building an array of these boxes but to save space I only want to show the next one when the first one gets filled.

So if they are empty it will show just the first row, when something is put in the first row they they show the second row and so on.

Any help is appreciated.
__________________
Placeholder, place signature here.
Reply With Quote
  #2 (permalink)  
Old 03-28-08, 12:11 AM
DAL's Avatar
DAL DAL is offline
Code Master
 
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
I would solve the first problem either by using PHP to record the submittion of an entry then populate a variable back through to the javascript

ie var pagesubmitted = "<?php echo $_SESSION['pagehasbeensubmitted']; ?>";

or you could use AJAX to keep the current varables. Im not too hot with JS so Im not sure if there is any way to store some kind of session variables within the client session using javascript but cookies (if enabled) might be an alternative.

As for the second problem, I suppose a onblur event would capture the box having been filled (with testing of entry) which would allow the condition to be met to show the next box. However think about how someone would go back to edit something they typed. If theres a forward and back button then this could loop through an array of text boxes quite successfully element.style.display="none" / "block" with the option of clicking back to find a previous entry to edit.

Hope this helps
Dal.
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Reply With Quote
  #3 (permalink)  
Old 03-28-08, 03:50 AM
Rapid Dr3am Rapid Dr3am is offline
Community VIP
 
Join Date: Jan 2004
Location: Liverpool, England
Posts: 752
Thanks: 0
Thanked 0 Times in 0 Posts
I can't use PHP in this, I'm using ASP.NET and C#.
__________________
Placeholder, place signature here.
Reply With Quote
  #4 (permalink)  
Old 03-28-08, 08:55 AM
DAL's Avatar
DAL DAL is offline
Code Master
 
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
Well there will be a session variable in ASP.NET or C# Im sure!

Did you even read past that?
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Reply With Quote
  #5 (permalink)  
Old 03-28-08, 11:17 AM
Rapid Dr3am Rapid Dr3am is offline
Community VIP
 
Join Date: Jan 2004
Location: Liverpool, England
Posts: 752
Thanks: 0
Thanked 0 Times in 0 Posts
Yeah I read it, sorry in a rush this morning. I do have the (!isPostBack) function I can use.

I've been looking around and found this:
- http://www.dustindiaz.com/seven-togglers/

Seems to do what I need for toggle, so just looking at the showing of the next row now.
__________________
Placeholder, place signature here.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help me about reload/refresh button ivan JavaScript 2 12-28-07 01:19 PM
PHP/MySQL Script sszukala Job Offers & Assistance 0 01-28-06 02:53 PM
Need help to modify slide show script sleph JavaScript 4 09-19-05 05:18 AM
help. Button clicked the score will appear? askman JavaScript 1 07-06-05 02:46 AM
Avoiding clicking refresh button webx2000i PHP 2 11-27-03 08:06 AM


All times are GMT -5. The time now is 11:37 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.