php - 1 line. Where to place ID in the link -
i have created separate posting large 1 of before because think have isolated cause of id value not getting passed.
i have link, there not correct , no value sent.
$soutput .= '"<a href=\"#' ."id=" .addslashes($arow['id_cruise']) .'\" class=\"flip\">'.addslashes($arow['from_country']).'</a>",';
that above line of interest.
and curiosity, snippet receives value
<script type="text/javascript"> $(document).ready(function(){ $('a.flip').live('click',function(){ $(".panel").slidetoggle("slow"); $('#reviews').load('sendidtodatabase.php', {idcruise: this.id}); }); }); </script>
so, whole scenario is:
a table, rows , links on column in rows.
when click on link, 2 things should happen.
a) slide panel opened
b) , value passed div inside panel (div loads result of php query received id value)
but said, expected link needs tweaked
thanks million
alvaro
update
well, 2 links have been proposed. none of them works.
this link allows slide panel open not populate div inside it
$soutput .= '"<a href=\"#\"' .' id=\"' .addslashes($arow['id_cruise']) .'\" class=\"flip\">'.addslashes($arow['from_country']).'</a>",';
and link seems opposite. slide wont open div seems loading info cant see because slide, said, doesnt open
$soutput .= '"<a href=\"?id=' .addslashes($arow['id_cruise']) .'\" id=\"' .addslashes($arow['id_cruise']) .'\" class=\"flip\">'.addslashes($arow['from_country']).'</a>",';
so, goal 1 line can make both things happening. open slide, , populate div. of course, using jquery snippet shown
alvaro, seems me link building code incorrect, ie
$soutput .= '"<a href=\"#' ."id=" .addslashes($arow['id_cruise']) .'\" class=\"flip\">'.addslashes($arow['from_country']).'</a>",';
would echo screen
<a href="#id=id_cruise" class="flip">from_country</a>
your html code wrong, in haven't closed off href , browser thinks href href="#id=id_cruise" instead of think trying do
$soutput .= '"<a href=\"#\"' .' id=\"' .addslashes($arow['id_cruise']) .'\" class=\"flip\">'.addslashes($arow['from_country']).'</a>",';
which should echo out correctly formed html this:
<a href="#" id="id_cruise" class="flip">from_country</a>
now href & id attributes correctly formed, jquery should able play nicely.
cheers, j.
Comments
Post a Comment