0

For example, would like 5 checks boxes to have their own submit button and the other 5 to have their own submit. Should be independednt of each other but they are not grouped together in the html page.
Do I nest the other form? Do I put them under the same name and if so how do I distinct the submit? Submit seems to submit the form name element, not the elements names within the form. (Using HTML and JS)

Thanks.

4
  • Can you clarify this a bit? And possibly post some code. Jan 15, 2009 at 0:16
  • Do people usually reply to comments in here or in an answer?
    – T.T.T.
    Jan 15, 2009 at 0:29
  • They request clarification here before they answer. Jan 15, 2009 at 1:04
  • @Tommy They edit the question.
    – alex
    Jan 15, 2009 at 1:47

3 Answers 3

1

Your clarification doesn't make too much sense from a user standpoint. Perhaps you want something like this:

<form action="/cgi-bin/Lib.exe" method="post" name="checks" id="Form1">
  <input type="checkbox" name="user" value="'$NAME'" id="Checkbox1" />
  <input type="checkbox" name="user" value="'$NAME'" id="Checkbox2" />

  <input type="submit" value="DELETE" id="Submit1" name="Submit1" />
</form>

<form action="/cgi-bin/Lib.exe" method="post" name="checks" id="Form2">
  <input type="checkbox" name="guest" value="'$NAME'" id="Checkbox1" />
  <input type="checkbox" name="guest" value="'$NAME'" id="Checkbox2" />

  <input type="submit" value="DELETE" id="Submit2" name="Submit2" />
</form>
0

I'd use the button element. Try this link: http://particletree.com/features/rediscovering-the-button-element/

Basically you use them as your submits. Firefox correctly sends the value attribute but IE sends the innerHTML. But they all come across as name=value/innerHTML.

So for example, using PHP, you could use

if (isset($_POST['nameOfButtonElement'])) {

echo 'user clicked this button';

}

EDIT: IE6 (surprise surprise) doesn't handle this correctly at all. See this question: IE 6 and the multiple button elements all sending their name & values

0

Maybe something like that (this way you can control it):

function ava_aken_hp()
{
// I use blank form with hidden fields to populate it with values from POST.

  document.blank.action="https://www.mypage.com";
  document.blank.elements["CHECK"].value=....;
  ...
  document.blank.submit();
}

// In your form:
<input type="submit" value="Submit1" onclick="ava_aken_hp();">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.