[Proto-Scripty] Re: click one checkbox will submit only one checkbox value (not the whole form) immediately

2010-03-11 Thread albert kao
What is the function submitjustthisone() look like?

On Feb 23, 9:54 pm, Al C al.caug...@gmail.com wrote:
 Albert - change the onclick to point to a javascript
 e.g.,
  input type=checkbox name=choicevalue=1
 onclick=submitjustthisone();

 Of course, youwillalso need to write this function
 script
 function submitjustthisone(){
 //do the stuff you need to do}

 /script

 On Feb 23, 4:58 pm, albert kao albertk...@gmail.com wrote:



  My JSP web page has many checkboxes.
  What is web page source code look like when clickingonecheckboxwill
 submitonlyonecheckboxvalue(not the whole form) immediately?
  i.e. togglingonecheckboxwillsend the info thatonlythatcheckbox
  is toggled.
  This does not work because clickingonecheckboxwillsend the whole
  page
  form name=myform method=post
  input type=checkbox name=choicevalue=1 onclick=submit();
  input type=checkbox name=choicevalue=2 onclick=submit();
  input type=checkbox name=choicevalue=3 onclick=submit();
  ...

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Re: click one checkbox will submit only one checkbox value (not the whole form) immediately

2010-03-11 Thread Douglas
Well, this has nothing to do with prototype, but you might use
Prototype's Ajax.Request[1] to send only the data from the checked
input (as follow):

e.g.:
form name=myform method=post
input type=checkbox name=choice value=1 onclick=myMubmit(this);
input type=checkbox name=choice value=2 onclick=myMubmit(this);
input type=checkbox name=choice value=3 onclick=myMubmit(this);
/form

function myMubmit(input) {
  new Ajax.Request(url, {
method: 'post',
parameters: input.name +'='+input.value,
onSuccess: function(r) {
  // show the result or do something wild
}
  });
}

You can also use Prototype's Event.observe[2] to check the click event
on each checkbox.

[1] http://api.prototypejs.org/ajax/ajax/request.html
[2] http://api.prototypejs.org/dom/event.html#observe-class_method

Cheers,

On Thu, Mar 11, 2010 at 12:50 PM, albert kao albertk...@gmail.com wrote:
 What is the function submitjustthisone() look like?

 On Feb 23, 9:54 pm, Al C al.caug...@gmail.com wrote:
 Albert - change the onclick to point to a javascript
 e.g.,
  input type=checkbox name=choicevalue=1
 onclick=submitjustthisone();

 Of course, youwillalso need to write this function
 script
 function submitjustthisone(){
 //do the stuff you need to do}

 /script

 On Feb 23, 4:58 pm, albert kao albertk...@gmail.com wrote:



  My JSP web page has many checkboxes.
  What is web page source code look like when clickingonecheckboxwill
 submitonlyonecheckboxvalue(not the whole form) immediately?
  i.e. togglingonecheckboxwillsend the info thatonlythatcheckbox
  is toggled.
  This does not work because clickingonecheckboxwillsend the whole
  page
  form name=myform method=post
  input type=checkbox name=choicevalue=1 onclick=submit();
  input type=checkbox name=choicevalue=2 onclick=submit();
  input type=checkbox name=choicevalue=3 onclick=submit();
  ...

 --
 You received this message because you are subscribed to the Google Groups 
 Prototype  script.aculo.us group.
 To post to this group, send email to prototype-scriptacul...@googlegroups.com.
 To unsubscribe from this group, send email to 
 prototype-scriptaculous+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/prototype-scriptaculous?hl=en.





-- 
D. G. Rodrigues
Consultoria e Auditoria em Desenvolvimento de Softwares

Believe nothing, no matter where you read it or who said it, unless it
agrees with your own reason and your own common sense.

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: click one checkbox will submit only one checkbox value (not the whole form) immediately

2010-02-23 Thread Al C
Albert - change the onclick to point to a javascript
e.g.,
 input type=checkbox name=choice value=1
onclick=submitjustthisone();

Of course, you will also need to write this function
script
function submitjustthisone(){
//do the stuff you need to do
}
/script

On Feb 23, 4:58 pm, albert kao albertk...@gmail.com wrote:
 My JSP web page has many checkboxes.
 What is web page source code look like when clicking one checkbox will
 submit only one checkbox value (not the whole form) immediately?
 i.e. toggling one checkbox will send the info that only that checkbox
 is toggled.
 This does not work because clicking one checkbox will send the whole
 page
 form name=myform method=post
 input type=checkbox name=choice value=1 onclick=submit();
 input type=checkbox name=choice value=2 onclick=submit();
 input type=checkbox name=choice value=3 onclick=submit();
 ...

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.