View Full Version : Form Submittal Query
HI There
Can any one help me.
I have a page with a form on it that i can get to submit onload with no problems and then redirect to a page with a script on it that auto closes the popup i use to run this function.
But can I get the form to submit without leaving the page i am without the user seeing the this happening. So with out the page reloading or the popup soultion i am using at present?
The page displays results from on online form that go into the database. I have serveral people picking up these messages and i have added a coloum into the database called viewed and i want to update this coloum when the record has been opened in certian pages.
This way i can have a filter to remove messages that have been opened from the urgent list and i Don't have a few people trying to research and answer the same question.
Any suggestions welcome.
I am using sql2000 for my database if this is any use?
Mhtml
11-26-2002, 09:14 AM
You could insert an iframe and have it real small and transparent as well as having the page it loads have the same background color so no one can tell it is even there, put it right at the bottom or float it or something.
Also you would need to have an if statement surrounding the code that is executed or at least put everything in a sub which is called when the conditions are right...
So get one of your values and have the if statement like this..
CheckLength = Len(Request.Form("ThisForm"))
If CheckLength > 0 then
DoActions()
Else
End If
That example is supposing that you are going to have your actions in a sub which would make them more manageable.
<iframe frameborder="0" src="scriptPage.asp" name="FormFrame"></iframe>
Hi Mhtml
Great minds must think alike.
I came up with this idea last night and tried it out this morning.
I have the iframe hidden and i have put a dropdown on the page for action taken so the user can choose to enter if they are answering this message or leaving it for someone else to reply.
And on the iframe page i have three hidden fields.
viewed = yes
action_taken = none
last_viewed = GETDATE()
this way when the message is opened the system should be updated to the fact it was open and when and that no action is being done.
Then it is up to the user to select an option on the form on the page with the message on to update the system to show what actions they are going to take.
Thanks for the help.:thumbsup: :thumbsup:
Mhtml
11-26-2002, 09:43 AM
Hey, no worries. :D
Glad you figured it out! :thumbsup:
just out of interest as i am just adding to final code some extras i am putting in like the nice little open and closed envolopes and spacing the table so it looks pretty for the ladies.
Will the getdtae() work the same as in sql or does the code need to be different to get the date out of the pc?
Dragging my brain backwards through a cheese grater this morning???:p :p :p
Mhtml
11-26-2002, 10:10 AM
date() will get the date on the server. Which should be the same on the persons computer as long as it is on time...
BUT I believe that there is a way of getting the users date..
But I'm not sure, maybe it can only be done through js.
date() will do i feel as this system will not be used outside the uk as a rule
cheers again. well must go and put this lot into practice.
thanks for the help.
:thumbsup: :thumbsup: :thumbsup:
Mhtml
11-26-2002, 10:57 AM
Well since it's only going to be in the UK it should work fine..
No worries..:D:D
I have tried this but the date() code trips the page into an error code if works ok if i take it out.
any ideas i have put the page below?:confused: :confused:
HA sort this out now
<%
Dim dtNow
dtNow = Now()
Response.Write FormatDateTime(dtNow, vbGeneralDate) & "<BR>"
Response.Write FormatDateTime(dtNow, vbLongDate) & "<BR>"
Response.Write FormatDateTime(dtNow, vbShortDate) & "<BR>"
Response.Write FormatDateTime(dtNow, vbLongTime) & "<BR>"
Response.Write FormatDateTime(dtNow, vbShortTime) & "<BR>"
%>
gives all sorts of date setus and it is really simply code
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.