This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > JSP Dynamic Email Address





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author JSP Dynamic Email Address
ezza

2004-08-24, 4:15 am

Hi, i need to generate a dynamic list of emails from a db with hrefs (mailto:)
built in.
i took this approach from the macromedia tech notes and can't get it to fire.
Can anyone tell me why this tag works -

<%=(((Recordset1_data = Recordset1.getObject("Email"))==null ||
Recordset1.wasNull())?"":Recordset1_data)%>

and this throws an execption ('No data found")-

<a href="mailto:<%=(((Recordset1_data = Recordset1.getObject("Email"))==null
|| Recordset1.wasNull())?"":Recordset1_data)%>"><%=(((Recordset1_data =
Recordset1.getObject("Email"))==null ||
Recordset1.wasNull())?"":Recordset1_data)%></a>

any help would be great...

Chris In Madison

2004-08-26, 12:18 pm

If you run the same query from the database's command line that you're using
to build this recordset, does it return any results? What kind of DB are
you using?

Best regards,
Chris


ezza

2004-08-26, 12:20 pm

Chris, thanks for your reply. I don't normally work in JSP code but I took it
apart bit by bit and came up with this...

- it seems that 'Recordset1_data' already gets a value from the first
iteration and doesn't like being told it has to recalculate itself. thus...

a href="mailto:<%=(((Recordset1_data = Recordset1.getObject("Email"))==null ||
Recordset1.wasNull())?"":Recordset1_data)%>"><%=(Recordset1_data)%></a

is the solution... cheers

Chris In Madison

2004-08-26, 12:20 pm

Great :-) Thanks for sharing your solution.

Best regards,
Chris


Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews