Toggle button and show next

03-27-08, 09:05 AM
|
|
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.
|

03-28-08, 12:11 AM
|
 |
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."
|

03-28-08, 03:50 AM
|
|
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.
|

03-28-08, 08:55 AM
|
 |
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."
|

03-28-08, 11:17 AM
|
|
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.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|