Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Submit Form Notification Message

Reply
Thread Tools

Submit Form Notification Message

 
 
JP
Guest
Posts: n/a
 
      03-15-2007
Hi folks,

Using ASP and/or JavaScript, how do you create that little
notification message (usually in red below the submit button) when the
Submit button is pushed. Something that says "Your information is
being sent ..."

Thanks for any assistance.

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      03-15-2007
JP wrote on 15 mrt 2007 in microsoft.public.inetserver.asp.general:

> Using ASP and/or JavaScript,


ASP is not a programming language, but a serverside platform for
javascript, VBscript, etc. So the "or" is not possible.

> how do you create that little
> notification message (usually in red below the submit button) when the
> Submit button is pushed. Something that says "Your information is
> being sent ..."


It is being done clientside, so ASP cannot do that.

Please ask a clientside NG, like:

comp.lang.javascript


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      03-15-2007

"JP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi folks,
>
> Using ASP and/or JavaScript, how do you create that little
> notification message (usually in red below the submit button) when the
> Submit button is pushed. Something that says "Your information is
> being sent ..."
>
> Thanks for any assistance.
>


<script type="text/javascript">

function doSubmit()
{
var form = this.form
this.nextSibiling.style.visibility = 'visible'
window.setTimeout(fnSubmit, 0)

function fnSubmit()
{
form.submit()
}
}

</script>

<input type="button" onclick="doSubmit.call(this)" value="Send" /><br />
<span style="visibility:hidden; color:red">Sending...</span>


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      03-15-2007
Anthony Jones wrote on 15 mrt 2007 in
microsoft.public.inetserver.asp.general:

>
> "JP" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
>> Hi folks,
>>
>> Using ASP and/or JavaScript, how do you create that little
>> notification message (usually in red below the submit button) when
>> the Submit button is pushed. Something that says "Your information
>> is being sent ..."
>>
>> Thanks for any assistance.
>>

>
> <script type="text/javascript">
>
> function doSubmit()
> {
> var form = this.form
> this.nextSibiling.style.visibility = 'visible'
> window.setTimeout(fnSubmit, 0)
>
> function fnSubmit()
> {
> form.submit()
> }
>}
>
> </script>
>
> <input type="button" onclick="doSubmit.call(this)" value="Send" /><br
> /> <span style="visibility:hidden; color:red">Sending...</span>


Wouldn't the next sibling be the <br>?

call Method (JScript 5.6):
> Calls a method of an object, substituting
> another object for the current object.


Could you explain for us mortals what the call() here does?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      03-15-2007

"Evertjan." <(E-Mail Removed)> wrote in message
news:Xns98F46DC104C99eejj99@194.109.133.242...
> Anthony Jones wrote on 15 mrt 2007 in
> microsoft.public.inetserver.asp.general:
>
> >
> > "JP" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed) oups.com...
> >> Hi folks,
> >>
> >> Using ASP and/or JavaScript, how do you create that little
> >> notification message (usually in red below the submit button) when
> >> the Submit button is pushed. Something that says "Your information
> >> is being sent ..."
> >>
> >> Thanks for any assistance.
> >>

> >
> > <script type="text/javascript">
> >
> > function doSubmit()
> > {
> > var form = this.form
> > this.nextSibiling.style.visibility = 'visible'
> > window.setTimeout(fnSubmit, 0)
> >
> > function fnSubmit()
> > {
> > form.submit()
> > }
> >}
> >
> > </script>
> >
> > <input type="button" onclick="doSubmit.call(this)" value="Send" /><br
> > /> <span style="visibility:hidden; color:red">Sending...</span>

>
> Wouldn't the next sibling be the <br>?


You're quite right. I wrote the code then added the BR as an after thought.

nextSibliling.nextSibling would be necessary.

>
> call Method (JScript 5.6):
> > Calls a method of an object, substituting
> > another object for the current object.

>
> Could you explain for us mortals what the call() here does?


It calls the doSubmit function as if the input had a doSubmit method
attached. Hence in the doSubmit execution the 'this' context is the input
element.

It could have been written:-

function doSubmit(elem)
{
var form = elem.form
elem.nextSibling.nextSibiling.style.visibility = 'visible'
window.setTimeout(fnSubmit, 0)

function fnSubmit()
{
form.submit()
}
}

and onclick would be "doSubmit(this)"

However I prefer .call since it is consistent with assigning the event
handler in code:-

elem.onclick = doSubmit

Anthony


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert form to submit on load instead of clicking submit button? Network-Man HTML 5 07-07-2012 12:06 PM
submit 1 form to 2 servers or 2 forms to 2 server (1 form each) on 1 submit abansal.itp@gmail.com Javascript 3 06-23-2007 07:29 AM
Submit Form Notification Message JP ASP .Net 0 03-15-2007 05:11 AM
Forms with multiple submit buttons vs 'form' objects with single 'submit' methods neil.fitzgerald@ic.ac.uk Python 4 04-14-2006 04:58 PM
submit the form data to the popup window without a submit button jrefactors@hotmail.com HTML 2 01-01-2005 06:07 AM



Advertisments