Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit form with multiple values

Status
Not open for further replies.

Nebooaw

Programmer
Jun 1, 2001
142
GB
Hi, dies anyone have an example of a form submitted by javascript with multiple values i.e;

action="process.asp?id=12345&ref=abcde"

Kind regards
 

Nebooaw-

Would you mind elaborating a little more?

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Sorry, does this help.. im after somthing like this..

function test(id){
form1.action.value = "process.asp?id="+[id];
form1.submit();
}

kindest thanks
 
Why don't you create hidden fields?

Code:
<form name="form1" action="process.asp">
  ... regular fields ...
  <input type="hidden" name="id" />
  <input type="hidden" name="ref" />
</form>

And then in your code:

Code:
function test(id, ref){
    var f = document.forms['form1'];
    f.elements['id'].value = id;
    f.elements['ref'].value = ref;
    f.submit();
}

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Nebooaw:
Are you suggesting that your function is causing errors? If so, try using
Code:
document.forms['form1'].action = "proccess.php?id="+id;
(just .action, not .action.value)

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top