![]() |
| |||||||
| Sponsored Links |
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| 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>
|
| Sponsored Links |
|
#2
| ||||
| ||||
| 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. |
|
#3
| |||
| |||
| 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 |
|
#4
| ||||
| ||||
| 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. |
|
#5
| |||
| |||
| 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 |
|
#6
| ||||
| ||||
| 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 |
|
#7
| |||
| |||
| buddy, you always come for help. Thank you. Can you tell me how i can use anchor tag with my code todd |
|
#9
| |||
| |||
| 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 |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
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 |