HTML Help Forum Index HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

using javascript to submit form in asp
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum Index -> ASP
View previous topic :: View next topic  
Author Message
rollsroyce1400



Joined: 12 Sep 2006
Posts: 34

Posted: Thu Sep 18, 2008 10:37 am     using javascript to submit form in asp  

So heres the problem:
i have a js function updaterecord which passes in an id. the js then has a hidden form value = ID then submits the form.

My problem is when its on the next page the value is still at default even though i know it was the correct value when on the original page..


User clicks this
Code:
<td align="center"><input type="submit" name="Update"  value="Update" onClick="UpdateRecord(<%= rstMatrix.Fields("ID").Value %>)"></td>


JS function
Code:
function UpdateRecord(intPrimaryKey)

{
       document.getElementById('intUpdatePrimaryKey').Value = intPrimaryKey;

            document.frmUpdate.submit();
}



and heres the hidden form which has the new value (but value doesnt transfer to UpdatePlantMfg.asp, rather stays as -1)


Code:
   <form name="frmUpdate" method="post" action="UpdatePlantMfg.asp">
            <input type="hidden" name="intUpdatePrimaryKey" value="-1" />
   </form>



Ive tried alot and have not been able to figure this out..any help is appreciated!!
rollsroyce1400



Joined: 12 Sep 2006
Posts: 34

Posted: Thu Sep 18, 2008 11:28 am      

figured it out.....

.value (case sensitive) DUH :oops:
 
 
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum Index -> ASP
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group