amit said the following on 5/1/2007 4:34 PM:
>
Hello group,
How can I assign a link with its related elements (as following) to an
array element?
Assume having a table with several rows and 3 columns.
The first column holding some text information (which will be read
from a database) but
the 2nd column holding a link (as its previous rows - now I'm adding a
new row).
Since I'm adding records or rows to this table I need to provide the
link in the 2nd column and the worst thing thing, this is my first PHP
project!
Any advice?
<span id=\"button_<?=$item?>_edit\"><a href=\"javascript:edit('<?=
$item?>', 1, '<?=$max?>');
javascript:MyFunc(document.getElementById('iptext_ <?=$item?>'));\"
>Edit</a</span>;
Don't post the PHP code, post the code the browser gets. If you view
source in the browser you won't see a close for the <a tag and probably
looks something like this:
<span id="button_something_edit">
<a href="javascript
:edit('something','1','maxSomethin g');
javascript
:MyFunc(document.getElementById('iptext_ something'));"
Edit
</a>
</span>
I prettied it up to prevent line wrapping.
Note the lack of the Before the word Edit so that it isn't valid HTML.
Also, don't use javascript
: pseudo-protocols.
<URL: http://jibbering.com/faq/index.html#FAQ4_24>
If you don't need the link action, use a button.
Also, what is the point in wrapping a link in a span element?
<button onclick="edit('something'.......)">Edit</button>
This is what I have done but doesn't work:
myArray[1] = myArray[1] + "<span id=\"button_<?=$item?>_edit \">";
myArray[1] = myArray[1] + "<a href=\"javascript:edit('<?=$item?>', 1,
'<?=$max?>');";
myArray[1] = myArray[1] +
"javascript:myFunc(document.getElementById('iptext _<?=$item?>'));\"
>Edit</a</span>";
Again, the PHP code isn't of much use. Post the code that the browser
gets. What is the intent for the array you are creating?
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -
http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/