
Client side scripting / server side scripting
I have a problem in my application ... I don't know how to figure it out how
to send informations through the server after a client side validation ?
But first let me explain you the context of my application ...I'm presently
building a newsgroup for a corporate organization ...the UI is made of 3
frames.
The first frame is where all the function available to the end user are
shown i.e.:
1- compose a message
2- send a message
...
The second frame is where the end user can see all the messages send by all
the others. (message tree)
The last frame is where the user can read or write message.
So when the user click on the compose function, the third frame changes (i.e
a form appears)
ex:
...
<form >
<input type=text name=msgsubject size=72 value="<%=txtmsgsubject %>"
<textarea name=msgbody cols=80 rows=200 wrap=soft ><%=txtmsgboby
%></textarea>
</form>
...
Note: The reason that there is no "submit" button in this form is because
they wants that all the functions must be made form the toolbar (first
frame)
Then when the user clicks on the send button (located on the first frame)...
...
<img src="" width=30 height=30 border=0 alt="Poster" onClick=CheckForm()>
...
it performs a client side validation...(on the third frame)
Sub CheckForm ()
Dim MsgForm,Strtxtsubject,StrtxtBody,BlnIsValid
BlnIsValid=true
If CStr(parent.frames(2).document.title) = "Viewonemsg" Then
MsgBox "Veuillez crire un message avant de procder son
envoie.",64,"Fontion non disponible."
BlnIsValid=false
Else
Set MsgForm=parent.frames(2).document.msg
Strtxtsubject=CStr(MsgForm.msgsubject.value)
If Strtxtsubject ="" Then
MsgBox "Votre message n'a pas de sujet.",64,"Message sans sujet"
BlnIsValid=false
End If
StrtxtBody=CStr(MsgForm.msgbody.value)
If StrtxtBody = "" Then
MsgBox "Votre message est vide.",64,"Message vide"
BlnIsValid=false
End If
End If
If BlnIsValid = true Then
IntButtonClicked = MsgBox ("tes-vous certain de vouloir envoyer ce message
?",36,"Confirmation d'envoie")
If IntButtonClicked = vbYes Then
MsgBox "Votre message a t envoy avec succs",64,"Opration
effectue avec succs"
REM --- SEND INFO TO THE SERVER 'S DATABASE
End If
MsgForm.reset
End If
End Sub
All my pages are asp based ... I have tried sereval solutions ... (and some
results like the browser crash or empty parameters...) in order to send my
info to my database
Thank you !
Juan Pablo Escobar Zuniga
Intern in computer science
Canadian International Developement Agency
819-997-6924