Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » How To Create A Button Control That Does Not Submit The Form [RSS Feed]

#1 Jan. 21, 2011 20:50:10

h.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How To Create A Button Control That Does Not Submit The Form


I have a text field for entering a destination email address. Once the
address is entered I want to click a button on my screen which will
then append the new email address to another textarea field on the
screen, which will hold the entire list of recipients of the email
message. I would like my button when clicked to call my addRecipient
javascript function to do the appending. I have the addRecipient()
function coded like this:

function addRecipient()
{
alert("Entering addRecipient function!")
var list = document.getElementById('recipientlist');
var rlist = list.value;
var reciever = document.getElementById('recipient');
rlist = rlist + receiver.value + ", ";
reciever.value = "";
}

and the alert tells me that my button is calling, but I don't see the
fields updated on my screen. Does my javascript function also need to
call some kind of browser window refresh method or something like that
for me to be able to see that it's actually updating the fields as
it's supposed to? Thanks for the help.

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 22, 2011 13:26:42

Hervé M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How To Create A Button Control That Does Not Submit The Form


Hi,

you have some "reciever" and some "receiver" spelling in your code?

Hervé

On 21 jan, 21:50, hank23 <hversem...@stchas.edu> wrote:
> I have a text field for entering a destination email address. Once the
> address is entered I want to click a button on my screen which will
> then append the new email address to another textarea field on the
> screen, which will hold the entire list of recipients of the email
> message. I would like my button when clicked to call my addRecipient
> javascript function to do the appending. I have the addRecipient()
> function coded like this:
>
>   function addRecipient()
>   {
>           alert("Entering addRecipient function!")
>           var list = document.getElementById('recipientlist');
>           var rlist = list.value;
>           var reciever = document.getElementById('recipient');
>           rlist = rlist + receiver.value + ", ";
>           reciever.value = "";
>   }
>
> and the alert tells me that my button is calling, but I don't see the
> fields updated on my screen. Does my javascript function also need to
> call some kind of browser window refresh method or something like that
> for me to be able to see that it's actually updating the fields as
> it's supposed to? Thanks for the help.

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » How To Create A Button Control That Does Not Submit The Form [RSS Feed]

Board footer

Moderator control

Enjoy the 19th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support