form post (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


dido_11 -> form post (3/3/2001 20:18:00)

I have an access database like this:

code description CustId
001 Aquarium 123
002 Fishfeeds 345
003 Fertilizer 567


i make use of the following asp code

<form method="POST" action="viewcode.asp">
<select size="1" name="code">
<option value="<%=rs("description")%>"><%=rs("code")%></option>
</select>
<input type="submit" value="Submit" name="B1"></p>
</form>

as i understand, this code when run will show the user the description and the post information will contain the codes. How can i submit together with the code the CustId?

Thanks in advance.





Spooky -> RE: form post (3/4/2001 20:00:00)

Ideally you shouldnt, as the 'code' already contains reference to a foreign key.
Any queries that look up '002' for example, will always still relate to '345'.

The code would form the ID :

<option value="<%=rs("Code")%>"><%=rs("description")%></option>

An option would be to concatenate the code field and the ID field:

<%=rs("Code")& rs("CustId")%>

Thus giving 002345

But it would depend on the end use you require


------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!





dido_11 -> RE: form post (3/4/2001 20:41:00)

Thanks Spooky,

in your code:

<%=rs("Code")& rs("CustId")%>

both the Code and the CustId will be seen by the user. What if we dont want the user to see the CustId and still the CustId will be carried over to another asp page?

Dido





Spooky -> RE: form post (3/4/2001 14:45:00)

Ultimately, to pass both from the same page, they would be visible in html code.

If only 'code' was used, on the next asp page, that I assume does some processing, you could then find the related custID based on 'code'

That way, it wouldnt be visible at all.

------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.09375