Jump to content

j.silver

Members
  • Posts

    142
  • Joined

  • Last visited

Everything posted by j.silver

  1. Dear dsonesuk,This was a first-class code. I hope one day I can gain some advanced skills in coding such as yours. Many thanks.
  2. Many thanks niche and dsonesuk for your sincere efforts and help.
  3. Dear dsonesuk,Many thanks for a well-thought scripts. The only thing we might still need to nail down is making the form accept multiple entries.
  4. Though I have not really thought of or tried to base my inputs on a sql query, I think it will not workas I want it to be because my end result should be a list of <options></options>, both tags inclusive.
  5. Yes niche. Apache/2.4.7 (Win32) PHP/5.5.9 mysql 5.0.11
  6. Dear niche, I really thank you very much for the sincere efforts. I tried to make it dynamic, but couldn't work due to the different types of data. The only option left for me really is to make it a stand alone script, get it to sort the data separately, then only insert it within the final code.
  7. Many thanks Ingolme for your input. I never thought PHP might be limited in echoing such a result. I regret that I do not know JS. If you may help me with the code that you think would do the requirement, it would be appreciated and might be my first step towards learning JS.
  8. I am having them separate in a stand-alone script to continue updating and modifying them in time and away from the final code. Once complete and in their final list of options, insert them within the select tags of the final code. You might ask: why then you don't include them within the select tags in the final code and keep adding to the final code. The answer is: because other future options will have different value type than their predecessors, so if I will add them to the same select tags it will mess up the whole list.
  9. I am not working through a form niche. I am using a separate script (the one in my first post). This is an independent and stand-alone script.
  10. Thanks again niche. It is not radio, nor check box. It is indeed a drop down menu, but not in its final shape. I am looking for a code that will produce the list of options as given earlier, i.e., a complete list of options sorted alphabetically and ready to be inserted within the select tags at a later stage. Now, I want an output in a complete list, sorted alphabetically exactly as given earlier.
  11. Another thing is that the above code (with select) makes the output in a drop down menu. The final output I am looking for should be a complete sorted lines of output (not in a drop down menu), exactly as: <option value="Moose Jaw,SK,Canada">Moose Jaw,SK,Canada</option><option value="Prince Albert,SK,Canada">Prince Albert,SK,Canada</option><option value="Regina,SK,Canada">Regina,SK,Canada</option><option value="Saskatoon,SK,Canada">Saskatoon,SK,Canada</option>
  12. Many thanks niche for the help and speedy response. Yes, it works fine when <select> is added. However, I am keen to get it work without the <select> tag for a reason too lengthy to address, hence not worth mentioning. I hope it is not impossible to achieve it without <select>, and any assistance will be highly appreciated.
  13. The minute I begin typing <option> tag, one array value disappears from the output. By the time the echo code line is complete, as written above, no values are printed, just a blank page.
  14. Hi everyone. I'm trying to echo the values of an array inside HTML's <option> tag. The following should be echod: <option value="Moose Jaw,SK,Canada">Moose Jaw,SK,Canada</option> <option value="Prince Albert,SK,Canada">Prince Albert,SK,Canada</option> <option value="Regina,SK,Canada">Regina,SK,Canada</option> <option value="Saskatoon,SK,Canada">Saskatoon,SK,Canada</option> The code I attempted was: <!DOCTYPE html> <html> <body> <?php $sk=array("Saskatoon","Regina","Moose Jaw", "Prince Albert"); sort($sk); foreach ($sk as $value) { echo '<option value="'.$value.',SK,Canada">'.$value.',SK,Canada</option>'; echo "<br>"; } ?> </body> </html> Pls. note that the values of the array are not sorted alphabetically. The output, however, should be sorted in ascending format and be within the <option> tag after adding the province and country. Though the select element will be there in the final code, I ignored it here because I am able to manage it separately. I now want to do what I explained only, which I am unable to yet. Any help will be highly appreciated.
×
×
  • Create New...