Discussion:
jQuery Dialog - links not calling correct function
Don Wieland
2014-03-28 20:38:08 UTC
Permalink
I have this weird behavior going on - probably something simple (just learning jQuery):

Here is my javascript link:

http://rts.dwdataconcepts.com/rts1/js/edit_cau.js

In my PHP page I am calling the script:

<script src="js/edit_cau.js" type="text/javascript"></script>

Then I have a table whic has 2 <TD>s with LINKS to trigger the scripts:

<td align="center"><a class="text_link" href="ajax/view_text.php?id=<?php echo $row2['cau_id']; ?>"><b>View</b></a></td>

This pops up a dialog to just read text

<td align="center"><a class="req_link" href="ajax/edit_cau.php?id=<?php echo $row2['cau_id']; ?>"><b>Edit</b></a></td>

This pops up a dialog with a FORM in it.

Problem: When I add the second function:

$(function() {
var $div1 = $('.text_link');
$(".text_link").click(function() {

The first function "req_link" uses it instead of it's own function.

I must have something simple out of place or missing. Little help!

Don Wieland
***@pointmade.net
http://www.pointmade.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ashley Sheridan
2014-03-29 07:01:12 UTC
Permalink
This isn't really a JavaScript list, you would get better answers asking on one of those, or more specifically a jQuery list.
Post by Don Wieland
http://rts.dwdataconcepts.com/rts1/js/edit_cau.js
<script src="js/edit_cau.js" type="text/javascript"></script>
<td align="center"><a class="text_link"
href="ajax/view_text.php?id=<?php echo $row2['cau_id'];
?>"><b>View</b></a></td>
This pops up a dialog to just read text
<td align="center"><a class="req_link" href="ajax/edit_cau.php?id=<?php
echo $row2['cau_id']; ?>"><b>Edit</b></a></td>
This pops up a dialog with a FORM in it.
$(function() {
var $div1 = $('.text_link');
$(".text_link").click(function() {
The first function "req_link" uses it instead of it's own function.
I must have something simple out of place or missing. Little help!
Don Wieland
http://www.pointmade.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thanks,
Ash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...