Nov 4, 2004 #1 Nebooaw Programmer Joined Jun 1, 2001 Messages 142 Location 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
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
Nov 4, 2004 #2 cLFlaVA Programmer Joined Jun 14, 2004 Messages 6,450 Location US 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! Upvote 0 Downvote
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!
Nov 4, 2004 Thread starter #3 Nebooaw Programmer Joined Jun 1, 2001 Messages 142 Location GB Sorry, does this help.. im after somthing like this.. function test(id){ form1.action.value = "process.asp?id="+[id]; form1.submit(); } kindest thanks Upvote 0 Downvote
Sorry, does this help.. im after somthing like this.. function test(id){ form1.action.value = "process.asp?id="+[id]; form1.submit(); } kindest thanks
Nov 4, 2004 #4 cLFlaVA Programmer Joined Jun 14, 2004 Messages 6,450 Location US 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! Upvote 0 Downvote
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!
Nov 4, 2004 #5 chessbot Programmer Joined Mar 14, 2004 Messages 1,524 Location US 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 Upvote 0 Downvote
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