Jump to content

_tina_

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

Everything posted by _tina_

  1. Thank you for that. How exactly would I do that? My JavaScript isn't very good. Thanks again.
  2. Thats what I thought but when I pass in x.pdf, x.doc or x.jpg it doesn't recognize them as being of that file type. My main problem though is the first one, is there a way you know of to make it ignore files and just test for URL's? I can't seem to get the regular expression correct.
  3. Thanks for that Alex, that makes a lot of sense. I guess I'll have to find an alternate way to achieve this. Thanks again.
  4. $file is declared, I just didn't copy that part of my code. I have read the header function page, not really sure whats going on here. Anybody have any ideas?
  5. Hi, I have two functions. One checks if a string is a URL an the other checks for certain file types. The issue with the one checking for a URL is that, it also thinks that a file is a URL. function isValidURL(url){ var RegExp = /^(([\w]+?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/; if(RegExp.test(url)){ return true; }else{ return false; } } I nee this to check if it's a URL and ignore files. Then this one to check for files, it's basically just not working, can anyone see where I'm going wrong on this one? function checkExt(e) { value=e.value; if( !value.match(/\.(doc)|(jpg)|||(pdf)$/) ){ return true; } else { return false; } } Thanks in advance
  6. Hi, I have a page, you click on a link and are brought to a new page which forces a PDF download. The problem is that the file starts to download and the page doesn't even load an stays on the current page. So I click the link, the file starts but I stay on the current page. Is there a way around this? Thanks in advance. This is the page that forces the download which never loads. header("Content-type: application/pdf"); header("'Content-Disposition: attachment; filename=\"email.pdf\""); readfile($file); include("header.php"); //sleep(5); ?> <br> <p> Page content.. </p>
  7. Hi, I am trying to add a date picker box to my form. Does anybody know how to do this? $this->setMethod( 'post' ); $this->setAttrib( 'id', 'admin_form_page' ); $this->setAttrib('enctype', 'multipart/form-data'); $elements['id'] = $this->createElement( 'hidden', 'id' ); $elements['created'] = $this->createElement( 'hidden', 'created' ); $elements['title'] = $this->createElement( 'text', 'title' )->setLabel('Title:'); $elements['announce_pub'] = $this->createElement( 'select', 'announce_pub' ) ->setLabel('Type:') ->setMultiOptions(array('announcement'=>'Announcement', 'publication'=>'Publication')); $elements['link'] = $this->createElement( 'select', 'link' ) ->setLabel('Link:') ->setMultiOptions(array('' => '', 'Url'=>'Url', 'PDF'=>'PDF')); $elements['url'] = $this->createElement( 'text', 'url' )->setLabel('Url:'); $elements['pdf'] = $this->createElement( 'file', 'pdf' )->setLabel('PDF:'); $elements['date'] = $this->createElement( 'text', 'date' )->setLabel('Date:'); Thanks in advance.
  8. I figured it out. I used: $('label[for=pdf]').parent().hide(); Thanks for the replies.
  9. Does anybody have any idea on this? Thank you. I hide the elements named "pdf" and "url". I just need to also hide their labels. I tried hiding by the label name "pdf-label" and "url-label" but this just hid the whole form.
  10. Here is the HTML generated: <dt id="link-label"><label for="link" class="optional">Link:</label></dt> <dd id="link-element"> <select name="link" id="link"> <option value="" label=""></option> <option value="Url" label="Url">Url</option> <option value="PDF" label="PDF">PDF</option> </select></dd> <dt id="url-label"><label for="url" class="optional">Url:</label></dt> <dd style="display: block;" id="url-element"> <input name="url" id="url" value="" type="text"></dd> <dt id="pdf-label"><label for="pdf" class="optional">PDF:</label></dt> <dd style="display: none;"> <input name="MAX_FILE_SIZE" value="133169152" id="MAX_FILE_SIZE" type="hidden"> <input name="pdf" id="pdf" type="file"></dd> and here is the zend_form: $elements['link'] = $this->createElement( 'select', 'link' ) ->setLabel('Link:') ->setMultiOptions(array('' => '', 'Url'=>'Url', 'PDF'=>'PDF')); $elements['url'] = $this->createElement( 'text', 'url' )->setLabel('Url:'); $elements['pdf'] = $this->createElement( 'file', 'pdf' )->setLabel('PDF:'); $elements['date'] = $this->createElement( 'text', 'date' )->setLabel('Date:'); I hide the elements named "pdf" and "url". I just need to also hide their labels. I tried hiding by the label name "pdf-label" and "url-label" but this just hid the whole form.
  11. Hi, I have a form which I show / hide fields based on a users selection. I use JQuery for this: <script type="text/javascript"> function toggle_field_type() { var field_type = $('#link option:selected').text(); if (field_type == '') { $('#url').parent().hide(); $('#pdf').parent().hide(); /*$('#url-label').parent().hide(); $('#pdf-label').parent().hide();*/ } if (field_type == 'PDF') { $('#url').parent().hide(); $('#pdf').parent().show(); } else if (field_type == 'Url') { $('#url').parent().show(); $('#pdf').parent().hide(); } } $(document).ready(function(){ toggle_field_type(); $('#link').change(function() { toggle_field_type(); }); }) </script> This is working fine, however, I need to also hide the labels for these two fields. Does anyone know how to do this? Thanks
  12. Hi, I have a series of rows returned from a query. I need to organize the results based on the year in the date column. For example: 2009 ------ row1 row2 ... 2008 ------ rowA rowB Do you know how I can achieve this? Thanks in advance.
  13. I tried: <div id="foo" style="display:block;"> but it had no effect
  14. Hi, Thanks for the reply. Here is the table. Thanks again. <h1>Edit <span><a href="<?=$this->url(array('action'=>'list'), null)?>">[return to listing]</a></span></h1> <table border="0" cellpadding="0" cellspacing="0" class="edittable" id="pagetable"> <tr style="vertical-align:top"> <td> <table border="0" cellpadding="0" cellspacing="0"> <thead> <tr class="header"> <th colspan="2"> </th> </tr> </thead> <tbody> <form action="/..." method="post" enctype="multipart/form-data"> <input type="hidden" name="data[id]" value="<?=$this->scroller['id'];?>" /> <tr> <td align="right" valign="top"><label for="data[title]">Title: </label></td> <td align="left" valign="top"><input type="text" value="<?=$this->scroller['title'];?>" name="data[title]" /></td> </tr> <tr> <td align="right" valign="top"><label for="data[url]">URL: </label></td> <td align="left" valign="top"><input type="text" value="<?=$this->scroller['url'];?>" name="data[url]" /></td> </tr> <div id="foo"> <tr id=tr1 style="visibility:visible; position:relative;"> <td align="right" valign="top"><label>Image:</label> </td> <td align="left" valign="top"> <img src="/images/scroller/thumb_<?=$this->scroller['link'];?>" /> </td> </tr> </div> <tr> <td> </td> <td><a href="#" id="hide" class="hide" onclick="toggle_visibility('foo');" title="Change Image">Change Image</a></td> </tr> <tr> <td> </td> <td><input type="file" name="s_image" id="s_image" /></td> </tr> <tr> <td align="right" valign="top"><label for="data[status]">Status:</label> </td> <td valign="top"><?=$this->formSelect('data[status]', $this->scroller['status'], array('id'=>'data[status]'), $this->status)?></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="submit" value="save"</td> </tr> </form> </tbody> </table> </td> </tr> </table>
  15. Hi, I have the following: <script type="text/javascript"> <!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--> </script> -- <a href="#" id="hide" class="hide" onclick="toggle_visibility('foo');">Test</a> This works fine and do as expected, but then when I move them into my table (I want to show/hide a tr), it does nothing. I also tried with JQuery and the same thing happened. <script type="text/javascript"> $(document).ready(function(){ $('a#hide').click(function(){ $('#box').hide(); return false; }); $('a#show').click(function(){ $('#box').show(); return false; }) }); </script> Does anyone know what is the problem? Thank you.
  16. _tina_

    IE8 CSS problem

    Also to note, where I set margin-left: 30px; When I test using F12 in IE8, it's showing up as a -115px value rather than 30px. Is there a way around this? Thanks again.
  17. Hi, I have the following. #memberlogin .logininput{ background:url(/images/memberlogin_formbg.gif) no-repeat left top; width:239px; height:42px; padding: 10px 10px 19px 25px; margin-left: 30px; overflow:hidden; } #memberlogin .logininput .email{ margin:0; padding:0; margin-bottom:5px; } #memberlogin .logininput .email, #memberlogin .logininput .password{ display:block; } #memberlogin p{ color:#cccccc; font-size:12px; } and the HTML <form id="memberloginform" action="/auth/authenticate" method="post"> <input type="hidden" value="http://staging.ratemybroker.s8.cnydevzone.com/" name="url"/> <div class="logininput"> </div> <div class="submitwrap"> </div> </form> This works fine in IE7 and FF but in IE8, it pushes the two form fields far over to the left and only displays from the middle of the box to the end. Any idea from the above of what might be causing this? Thanks in advance.
  18. Okay, thanks Cags for all the help
  19. Thank you for this cags. I had this before but it only returns one result. Also, I don't know the user_id before the query is run.
  20. I'm sorry, I'll try to explain better. id user_id row1 row2 row3 row4 .. row9 1 2 10 5 4 6 5 2 2 20 3 2 10 4 3 15 5 4 30 6 5 45 id is the PK, user_id is a FK and value is a float. Row1 to row9 are summed and the average is calculated. There can also be many of the same user_id's. These need to be grouped together and the average calculated. The output has to be in the range of 1.0 to 5.0 I hope that seems a little clearer. Thanks again.
  21. Thank you cags for your reply. In the database there is: id user_id value 1 2 10 2 2 20 3 2 10 4 3 15 5 4 30 6 5 45 I need to get each value. For where the user_id is the same, i.e. (user_id = 2 ), these should be summed and the average calculated. The problem is that these are just being ignored.
  22. Also, I appear to get the correct results when i: SELECT table1.id, table1.firstname, table1.lastname, (col1 + col2 + col3 + col4 + col5 + col6 + col7 + col8 + col9)/18 as average FROM table2 LEFT JOIN table1 on table2.broker_id = table1.id GROUP BY id ORDER BY average DESC LIMIT 10 But, if there is a column with the same value, in this case a foreign key. It just returns NULL for those rows.
  23. Thank you for this. It doesn't seem quite right though. It just returns all 1's which is incorrect. Why are you dividing by 18? Thanks
  24. _tina_

    Match

    I think the result is wrong because I put in data specifically to get results from that query so that leads me to believe that my query is wrong.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.