473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

How to assign HTML tag to array?


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>;


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>";

Regards,
Amit

May 1 '07 #1
3 3237
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/
May 1 '07 #2
On May 1, 2:40 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
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/


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?

May 1 '07 #3
On May 1, 3:16 pm, amit <amit.ko...@gmail.comwrote:
On May 1, 2:40 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
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/

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

May 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Golf Nut | last post by:
I am finding that altering and affecting values in elements in multidimensional arrays is a huge pain in the ass. I cannot seem to find a consistent way to assign values to arrays. Foreach would...
6
by: Ram Laxman | last post by:
Hi all, Can I assign an array to a vector if both(array and vector) holds same data type?
3
by: N. Demos | last post by:
How do you dynamically assign a function to an element's event with specific parameters? I know that the code is different for MSIE and Mozilla, and need to know how to do this for both. I...
16
by: sneill | last post by:
How is it possible to take the value of a variable (in this case, MODE_CREATE, MODE_UPDATE, etc) and use that as an object property name? In the following example I want 'oIcon' object to have...
3
by: Makiyo | last post by:
how do u do something like this char x; x = "hello"; I got an error, but is there a way I can do it without using pointer? thx ; )
26
by: Brett | last post by:
I have created a structure with five fields. I then create an array of this type of structure and place the structure into an array element. Say index one. I want to assign a value to field3 of...
7
by: Chris Wertman | last post by:
I am so lost on this one. Dim Ary as Integer = New Integer(4) {0,1,2,3} FAILS with the error: Array initializer has 1 too few elements. So I try Dim Ary as Integer = New Integer(3)...
4
by: johnners | last post by:
Hi all I'm having trouble assigning an attribute to a namespace using nusoap/php when creating a new soapclient. I can get the soapclient to assign the parameters correctly but can't assign an...
2
by: Akino877 | last post by:
Hello, I am new to HTML and PHP. And I am trying to assign an array of values to the <option value=...> of a combo list. But what I am trying to do is not working. I can sucessfully get it to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.