PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon May 20, 2019 6:46 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Mar 08, 2019 7:33 pm 
Offline
Forum Contributor

Joined: Fri Jul 18, 2014 1:54 pm
Posts: 179
Hi, I am trying something new. My first experiment failed. So before I bang my head against a wall :-) I thought I would ask if it is even possible.

This code works. I have it in a table which is inside a form and when I click the form's submit button a page is called and I loop the fooMelody to get at the data.
Syntax: [ Download ] [ Hide ]
echo("<td style='" . $StyleVaries . ";border:1px #c0c0c0 solid;text-align:left;vertical-align:top;width:5px;height:18px;' ><input type='textbox' name='fooMelody[]' value='$ParticipateMelody' readonly style='width:10px' onclick='funcInsertM(this.value,$CurrRow)'></td>\n");
 


This code also works.
Syntax: [ Download ] [ Hide ]
[syntax=php]   echo("<td style='" . $StyleVaries . ";border:1px #c0c0c0 solid;text-align:left;vertical-align:top;width:180px;height:18px;' ><a href='/BIAB/$fldKF_BIAB_File' download>$fldSNF_SongName</a></td>\n");[/syntax]
 


So I want to pick up the song name in a loop in the resulting page the same was as the text box data above. However I prefer not to set it up as a text box. So I tried the code adjustment below. It accepts it but bombs in the resulting page.
Syntax: [ Download ] [ Hide ]
   echo("<td style='" . $StyleVaries . ";border:1px #c0c0c0 solid;text-align:left;vertical-align:top;width:180px;height:18px;' ><a name='fooSongName[]' value='$fldSNF_SongName' href='/BIAB/$fldKF_BIAB_File' download>$fldSNF_SongName</a></td>\n");


I did some google searches and the <a> tag does not seem to have a value= parameter. It occurred to me I could set up a hidden column with a textbox duplicate of the song name and get that to work. However I am wondering if there is a simpler way. I have another table on the very same form and it is just a regular table display column. I am wondering if I can get at it in the resulting page as well.

Unfortunately if I can't get it to work within about 3 hours I need to leave this project until April and figure out a way to get it out of my mind :-) Not that easy for me to do :-( and the project I need to get done for March 31st is ultra critical. What would be helpful would be if someone could point out a book or whatever where I can find 1,000 ways to access an HTML table in a php result page (one for programmers new to a language). Any thoughts? I will start reading it in April :-)

Thanks,
John


Top
 Profile  
 
PostPosted: Mon Mar 25, 2019 10:28 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13590
Location: New York, NY, US
Use <textarea>:
Syntax: [ Download ] [ Hide ]
   echo("<td style='" . $StyleVaries . ";border:1px #c0c0c0 solid;text-align:left;vertical-align:top;width:180px;height:18px;' ><textarea name='fooSongName[]' cols='60' rows='2'>$fldSNF_SongName</textarea></td>\n");

_________________
(#10850)


Top
 Profile  
 
PostPosted: Tue Mar 26, 2019 11:16 pm 
Offline
Forum Contributor

Joined: Fri Jul 18, 2014 1:54 pm
Posts: 179
Thanks Christopher, it is good to know I can do that. Ultimately what I want it to be able to both 1/ loop the column of the table in the form using PHP and 2/ download if that table cell is clicked on. So I was thinking that using textarea to allow for the looping I might have to put in an "onclick call in each cell to a JavaScript function and execute the download from there. I did a google search out of curiosity to see if it was doable and the link below suggests it might be. I will dig into it in April. clicking on the text area to download it requires it not disturb the page.
https://stackoverflow.com/questions/3749231/download-file-using-javascript-jquery


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group