SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    can someone please alter this code for me

    We need to modify this code so that it will use both the icon and the label for the link can anyone please chage this so this is accomplished thanks

    Code:
    function generateDocEntry(icon, docDescription, link)
    {
    var retString =""
     
    // Change bak to target=folderFrame
    if (icon==0)
      retString = "<a href='"+link+"' target=folderFrame><img src='doc.gif' alt='Opens in right frame'"
     else
      retString = "<a href='http://"+link+"' target=_new><img src='link.gif' alt='Opens in new window'"
     retString = retString + " border=0></a><td nowrap><font size=-1 face='Verdana, Arial, Helvetica'>" + docDescription + "</font></a>"
     
     return retString
     
    }

    see this bit of code
    Code:
    if (icon==0)
      retString = "<a href='"+link+"' target=folderFrame><img src='doc.gif' alt='Opens in right frame'"
     else
      retString = "<a href='http://"+link+"' target=_new><img src='link.gif' alt='Opens in new window'"
     retString = retString + " border=0></a>
    we need to modify this so that the

    Code:
    <td nowrap><font size=-1 face='Verdana, Arial, Helvetica'>" + docDescription + "</font></a>
    also has the <a href=......> link code in it also (their are two rows i need what ever code is printed in the top table row to also print around the label of the following row)


    Please can someone help me

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <rant>
    Why don't you have someone from your training dept help you. It says they know HTML and JavaScript.

    http://www.trwebdev.com/services/training.html

    Maybe you can have them teach you some CSS stuff too, since you're still using <font> tags.
    </rant>

    Ok, now that I got that out of the way...here's your answer (if I understand you right, which I'm not sure I do...)

    Code:
    function generateDocEntry(icon, docDescription, link) {
    	var a1 = '<a href="'+link+'" target="'+(icon==0)?'folderFrame':'_new'+'">';
    	var a2 = '</a>';
    	var img = '<img src="doc.gif" alt="Opens in '+(icon==0)?'right frame':'new window'+'" border="0">';
    	var td = '<td nowrap><font size="-1" face="Verdana, Arial, Helvetica">'+ a1 + docDescription + a2 + '</font>';
    	return a1 + img + a2 + td;
    	}
    Last edited by beetle; Nov 20, 2002 at 21:52.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Sorry, but telling people to "alter code for me" doesn't make you look very good. Another way to say it is "I've tried everything, can you please help me out?" "Altering code" is what consultants are paid to do, not people trying to help you in the forums.

    --Vinnie

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by vgarcia
    Sorry, but telling people to "alter code for me" doesn't make you look very good. Another way to say it is "I've tried everything, can you please help me out?" "Altering code" is what consultants are paid to do, not people trying to help you in the forums.

    --Vinnie
    Hence the basis for my rant.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  5. #5
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Originally posted by beetle
    Why don't you have someone from your training dept help you.
    Why don't you get them to do it for you?

  6. #6
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Their away for the next few weeks. This has to be finished before then and its not my business client its my cosins whos a Access database programmer, so I'm lending him a hand with it


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •