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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submitting a form to itself doesn't pass values?

Status
Not open for further replies.

JohnBeals

Programmer
Feb 26, 2002
49
US
I have a form that displays differently based on the input. I change a variable and want to redisplay data with a button click. See code below.

(function info)
function ExpJobGrp(stuff)
{
var NewInd_Id = 10
document.frmInd_Per.Ind_ID.value = NewInd_Id
document.frmInd_Per.submit()
location = "Indicators_Per.cfm"
}
(button info)
<input type=&quot;button&quot; value=&quot;View Expense / Job By Group&quot; onclick=&quot;return ExpJobGrp(this)&quot;>

None of the form values get passed when I do this. If I copy the form to another name, say Indicators_Per_1.cfm, the form values get passed. I really don't want to create a bunch of extra files. I want to reuse my code.

What am I doing wrong?!?
TIA
John
 
Oops! I think I've got it.

This seems to work:

function ExpJobGrp(stuff)
{
var NewInd_Id = 10
document.frmInd_Per.Ind_ID.value = NewInd_Id
document.frmInd_Per.action = &quot;Indicators_Per.cfm&quot;
document.frmInd_Per.submit()
//location = &quot;Indicators_Per_1.cfm&quot;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top