Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Web Design > HTML & CSS Help

Sponsored Links

Discuss "display problem" in the HTML & CSS Help forum.

HTML & CSS Help - Discuss HTML, DHTML, XHTML and Cascading Style Sheets (CSS) here. Get tips on how to design your web site.


Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old June 12th, 2008, 04:25 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default display problem

Hi,

I have a problem and need some help how to solve it

I have a questionnare of 25 questions

every time the user fills out question 1 it will submit the page to itself and then display question 2

but what happens is when you fill out question 13 the page will refresh and then you have to scroll way down to see question 14

is there a way when a user completes the question the page will submit to itself and then display the next question and it will take them to that question instead of scrolling down
Or i can also take them down to the bottom of the page because thats where the question will be displayed

here is an example of how the question looks like
Code:
<table>
<tr> 
<td>1)What is your gender?</td>
<td>
<input type="radio" name="age" id="age" value="Female"
<% if Request.form("age")= "Female" then 
Response.Write "checked=""true""" 
Else
Response.Write "" 
end if
%>
onClick="this.form.action = '<%=Request.ServerVariables("Script_Name")%>'; this.form.submit();">Female
<input type="radio" name="age" id="age" value="Male" <% if Request.form("age")= "Male" then 
Response.Write "checked=""true""" 
Else
Response.Write "" 
end if
%>
onClick="this.form.action = '<%=Request.ServerVariables("Script_Name")%>'; this.form.submit();">Male
<input type="radio" name="age" id="age" value="Prefer Not To Answer" <% if Request.form("age")= "Prefer Not To Answer" then 
Response.Write "checked=""true""" 
Else
Response.Write "" 
end if
%>
onClick="this.form.action = '<%=Request.ServerVariables("Script_Name")%>'; this.form.submit();">Prefer Not To Answer

</td>
</tr>

<%
Dim getage
getage=Trim(Request.form("age"))

If getage <> "" then
%>
Question 2 goes here

<%

End if
%>
</table>
todd
Reply With Quote
Sponsored Links
  #2  
Old June 12th, 2008, 10:19 PM
dr_rock's Avatar
Drunk Barn Owl
 
Join Date: Jun 2008
Posts: 42
Thanks: 5
Thanked 3 Times in 1 Post
Rep Power: 1
dr_rock is on a distinguished road

Awards Showcase
Classic ASP 
Total Awards: 1

Default

I would use a case statement for something like this

Code:
If (IsNumeric(Request("question"))) Then 
  intQuestion = Cint(Request("question")) 'integer
Else
  intQuestion = 0
End If

If (intQuestion > 0) Then Call SaveResponse(intQuestion) 'saves your users data from last submit

Select Case intQuestion
  Case 1
   'display this step
  Case 2
   'display this step
  Case 3
   'etc.
  Case Else
   'default content
End Select

Last edited by dr_rock; June 12th, 2008 at 10:23 PM.
Reply With Quote
  #3  
Old June 13th, 2008, 10:08 AM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

Hi,

I didnt understand what you said.

Whats happening is when the questions are more the page becomes big and when the page is submitted to itself i see the top questions

When the page is submitted i want to see the next question on the screen i donr want to scroll down to find the question

todd
Reply With Quote
  #4  
Old June 13th, 2008, 11:22 AM
Wolffy's Avatar
Slaprentice of Wolves
 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 176
Thanks: 3
Thanked 24 Times in 21 Posts
Rep Power: 1
Wolffy is on a distinguished road

Awards Showcase
Microsoft .Net 
Total Awards: 1

Default

Just an idle thought really, but could you use anchors and move the anchor point down with each post so that the most recent question scrolls to the top of the screen?
__________________
Wolffy
------------------------
Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary.
Reply With Quote
  #5  
Old June 13th, 2008, 11:28 AM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

is there a way when the page is submitted i want to take the user to the bottom of the page instead of the top
Reply With Quote
  #6  
Old June 13th, 2008, 11:43 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 949
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

Wolffy's suggestion using the anchor tag would be your best bet.
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding

Reply With Quote
  #7  
Old June 13th, 2008, 01:05 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

buddy,

you always come for help. Thank you.

Can you tell me how i can use anchor tag with my code

todd
Reply With Quote
  #8  
Old June 13th, 2008, 01:26 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 949
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

Code:
<div id="qu1">Your question markup here</div>
Then the url would be: page.asp#qu1

This should give you the desired effect.
Reply With Quote
  #9  
Old June 13th, 2008, 02:31 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

hi,

Here is the code that does the page submit

onClick="this.form.action = '<%=Request.ServerVariables("Script_Name")%>#qu1' ; this.form.submit();"

it didnt work i am doing it in the right way


todd
Reply With Quote
  #10  
Old June 13th, 2008, 03:16 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 949
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

After you submit the page, does "#qu1" appear in the address bar?
Reply With Quote
Reply

  DeveloperBarn Forums > Web Design > HTML & CSS Help

Bookmarks

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
display problem checkbox todd2006 JavaScript Programming 4 May 30th, 2008 03:58 PM
display textboxes problem todd2006 JavaScript Programming 13 May 22nd, 2008 02:54 PM
display problem todd2006 JavaScript Programming 19 May 12th, 2008 02:08 PM
text display problem todd2006 HTML & CSS Help 10 May 7th, 2008 08:14 PM
IE and Mozilla display problem todd2006 HTML & CSS Help 11 April 18th, 2008 01:17 PM


All times are GMT -4. The time now is 03:01 PM.



Content Relevant URLs by vBSEO 3.2.0