How to assign HTML tag to array?

A

amit

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?>' said:
Edit</a> </span>;



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_ said:
Edit</a> </span>";


Regards,
Amit
 
A

amit

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('<?=

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','maxSomething');
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?

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_ said:
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/



Sure. first thanks for your response.

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. 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?
 
A

amit

amit said the following on 5/1/2007 4:34 PM:
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','maxSomething');
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/

Sure. first thanks for your response.

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. 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?


Actually what matter is not PHP is JavaScript here since this works on
client side not PHP.

Regards,
amit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top