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

Duplicate Data in Variable

Status
Not open for further replies.

Telsa

Programmer
Jun 20, 2000
393
US
I've a curious problem. I have a page with a form and submit button. The data captured to be carried forward is a simple number that is part of the recordset. However, when it reaches the next page, the number has a duplicate of itself in the variable. For instance, say the value for the record/field is 657. When it gets to the next page, it becomes 657, 657!

Here is the submit code... and I did a response.write to be sure it did get padded here instead of in my next page...


<td align=left >

<Form method=&quot;post&quot; action=&quot;pds_mailupdate.asp&quot;>
<input type=&quot;hidden&quot; name=&quot;pdsid2&quot; value=<% =objRst.fields(&quot;PDS_ID&quot;) %> >
<input type=&quot;submit&quot; value=&quot;Finalize&quot;></td>

<td align=right > <Form method=&quot;post&quot; action=&quot;pds_detailexisting.asp&quot;>
<input type=&quot;hidden&quot; name=&quot;pdsid2&quot; value=<% =objRst.fields(&quot;PDS_ID&quot;) %> >
<input type=&quot;submit&quot; value=&quot;Edit&quot;></td>


When the pds_mailupdate.asp opens, the pdsid2 has been padded... I checked by having the response.write write to the page so I can see if the variable shows that...

strPDSID = request.form(&quot;pdsid2&quot;)
response.write strpdsid
%>


Anyone have any clude why this is happening?? Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 
first off you have two <form tags started and none ending. you need to end the first before you open the second or &quot;Wierd things happen&quot;
ie..
<td align=left >

<Form method=&quot;post&quot; action=&quot;pds_mailupdate.asp&quot;>
<input type=&quot;hidden&quot; name=&quot;pdsid2&quot; value=<% =objRst.fields(&quot;PDS_ID&quot;) %> >
<input type=&quot;submit&quot; value=&quot;Finalize&quot;></td>
</form>

<td align=right >
<Form method=&quot;post&quot; action=&quot;pds_detailexisting.asp&quot;>
<input type=&quot;hidden&quot; name=&quot;pdsid2&quot; value=<% =objRst.fields(&quot;PDS_ID&quot;) %> >
<input type=&quot;submit&quot; value=&quot;Edit&quot;></td>
</form>

i think this is your problem...
 
I was hoping that would make a difference but it didn't... anything else you can think of???? Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 
Thank you, dsmith1000! That was it... didn't think it would make a difference because of two separate buttons. Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 
It looks as if you are trying to do one of two things to a single piece of information. i.e. Either Edit or Finalize something with a PDS_ID.

I would set up one form with radio buttons 'Edit' and 'Finalize' and a 'GO' button. The GO button (type=button not submit) would have a onClick=SubmitThisForm() javascript call. In Javascript set the action of the form dymanically depending on the status of the radio buttons then submit the form. Have one input type=hidden with the PDS_ID and whatever other info you need to pass to pds_detailexisting.asp or pds_mailupdate.asp.

I am not the best in JS but hears a stab:

function SubmitThisForm(){

var EditPg = 'pds_detailexisting.asp ';
var FinalPg = 'pds_mailupdate.asp';

if(form[0].rdoAction[0]==true){
//rdoAction[0] is finalize, rdoAction[1] is edit
form[0].action = FinalPg;
}else{
form[0].action = EditPg;
}

form[0].submit();

}




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top