Jump to content

eddy556

Members
  • Posts

    85
  • Joined

  • Last visited

About eddy556

  • Birthday 03/16/1987

Profile Information

  • Gender
    Male

eddy556's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a problem with the offsetLeft function in Firefox, it gives out different numbers than in IE. After a bit of research I have found out that this is very well known however I have yet to find a proper solution. This is my code (works in IE), is there any way this could be converted to work in both? function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft; curtop = obj.offsetTop; while (obj = obj.offsetParent) { curleft += obj.offsetLeft; curtop += obj.offsetTop; } } return [curleft,curtop]; }
  2. Ahh gud idea, I did try something similar - but I've finished work now so Ill test first thing monday :-)
  3. Sorry its is currently all under development and so there is no live server hosting this. The bug is caused by the output of this control: http://dotnetslackers.com/articles/aspnet/Custom_ASPNET_ComboxBox_Control.aspx I works perfectly in IE, but I know how firefox is on standards etc (not a bad thing). But no matter what I do I cannot produce a workaround.
  4. Please take a look at the following code, it works as expected in IE but in firefox gives this error: Error: ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper is not defined Source File: http://localhost:1981/user_area.aspx Line: 1 <div style="vertical-align:top; overflow:hidden;vertical-align:middle; table-layout:fixed;"> <span id="ctl00_ContentPlaceHolder1_lblCompName">Company Name:</span> <div id="ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper" nowrap="nowrap" style="width:auto;display:inline;"> <input name="ctl00$ContentPlaceHolder1$ComboBoxCompany$ComboBoxTextBox" type="text" id="ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox" onkeydown="if(event.keyCode == 9){ScsComboBox_ListBoxDisplaySelectedText(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox,ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox);return false;}" onkeyup="ScsComboBox_TextBoxKeyup(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox,ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox,event)" onmouseover="javascript:if(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox!=_activeComboBoxTextBox) ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';" onmouseout="javascript:if(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox!=_activeComboBoxTextBox) ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';" onfocus="javascript:ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';SetActiveComboBoxTextBox(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox);" onblur="javascript:ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';SetActiveComboBoxTextBox(null);ScsComboBox_TextBoxBlur(this,ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBoxWrapper)" /><img id="ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxPopupImage" onclick="ScsComboBox_ListBoxShow(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper,ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBoxWrapper);" src="/WebResource.axd?d=X2Mjr-4_fQgIerHGoJmLA4beQeL_mfrdmCV81jcoxue0BEu7vgKAFYZC1vKcoczQLOBzEgrPxoh-ptiiioWRcw2&t=633717605465074708" align="absmiddle" style="border-width:0px;" /><div id="ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBoxWrapper" style="position:absolute;visibility:hidden;top:-100px;left:-100px;"> <select size="5" id="ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox" name="ctl00$ContentPlaceHolder1$ComboBoxCompany" onclick="ScsComboBox_ListBoxDisplaySelectedText(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox,ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox);" onchange="shouldIPostBack()(this);" onkeyup="ScsComboBox_ListBoxKeyup(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox,ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox,event);" onblur="ScsComboBox_ListBoxHide(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox.offsetParent);javascript:ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';SetActiveComboBoxTextBox(null);" onmouseover="javascript:if(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox!=_activeComboBoxTextBox) ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';" onmouseout="javascript:if(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox!=_activeComboBoxTextBox) ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';" onfocus="javascript:ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';SetActiveComboBoxTextBox(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox);"> <option selected="selected" value="-1"></option> <option value="ABC Ltd">ABC Ltd</option> <option value="hello">hello</option> <option value="Tirril Brewery">Tirril Brewery</option> </select> </div> </div> With the following function called on the onclick event: function ScsComboBox_ListBoxShow(txtBxWrapper, lstBxWrapper) { if(lstBxWrapper.style.visibility == "visible") { ScsComboBox_ListBoxHide(lstBxWrapper); return; } var pos = findPos(txtBxWrapper); var top = pos[1]; var left = pos[0]; lstBxWrapper.style.left = left+1; lstBxWrapper.style.top = top+txtBxWrapper.offsetHeight; lstBxWrapper.style.visibility = "visible"; lstBxWrapper.all[0].focus(); lstBxWrapper.all[0].style.width = txtBxWrapper.offsetWidth; } I apologies for the formatting of the code, but I am interested in the image tags onclick event: <img id="ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxPopupImage" onclick="ScsComboBox_ListBoxShow(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper,ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBoxWrapper);" As you can see this fires the above javascript.
  5. Sorry for creating a new thread but I've just gone and solved this myself: function isWorkArea() { var strQuery; var arrayParm; var arrayValue; var Value1, Value2 strQuery = location.search.substring(1); arrayParm = strQuery.split("&"); if (arrayParm[0] != null) { arrayValue = arrayParm[0].split("="); Value1 = arrayValue[1]; } if (arrayParm[1] != null) { arrayValue = arrayParm[1].split("="); Value2 = arrayValue[1]; } if (Value1 == "undefined") { //Value1 does not exist } if (Value1 != "undefined" && Value2 == "undefined") { //Value1 exists and Value2 doesn't } }
  6. How can I check wether I certain variable is available in the URL? For example: if ([VARIABLE exists in URL]) { //Do this }
  7. Like I said this way it by design. Its becuase the bottom table is able to be scrolled whilst keeping the header (first table) static - i.e. the user can always see the header no matter which record they are viewing.
  8. I have the following HTML code which exists of two tables. One table is to act as the header, the other as the body. It is like this by design. My problem is even though every cell has its width set - the two tables do not line up.... <table id="ctl00_ContentPlaceHolder1_Table1" style="border-collapse: collapse;" border="1" cellspacing="0"> <tbody><tr> <td id="ctl00_ContentPlaceHolder1_mtrlcodeheader" style="width: 50px;"> <a id="ctl00_ContentPlaceHolder1_lnkSortCode" title="Sort by Material Code: Click once to sort acsending, again for decscending" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$lnkSortCode','')">Code</a> </td> <td id="ctl00_ContentPlaceHolder1_tradename" style="width: 210px;"> <a id="ctl00_ContentPlaceHolder1_lnkTradeName" title="Sort by Trade Name: Click once to sort acsending, again for decscending" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$lnkTradeName','')">Trade Name</a> </td> <td id="ctl00_ContentPlaceHolder1_keyword" style="width: 130px;"> <a id="ctl00_ContentPlaceHolder1_lnkKeyWord" title="Sort by Keyword: Click once to sort acsending, again for decscending" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$lnkKeyWord','')">Keyword</a> </td> <td id="ctl00_ContentPlaceHolder1_supp" style="width: 250px;"> <a id="ctl00_ContentPlaceHolder1_Supplier" title="Sort by Company: Click once to sort acsending, again for decscending" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Supplier','')">Company</a> </td> <td id="ctl00_ContentPlaceHolder1_chkbx" style="width: 54px;"> </td> </tr> </tbody></table> <!-- Height="149px" --> <div> <table id="ctl00_ContentPlaceHolder1_GridView2" style="border-collapse: collapse;" rules="all" border="1" cellspacing="0"> <tbody><tr style="text-decoration: none;" onmouseover="javascript:setMouseOverColor(this);" onmouseout="javascript:setMouseOutColor(this);"> <td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl02$ctl00','')" style="background-color: Yellow; width: 50px;">604</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl02$ctl00','')" style="width: 210px;">WD-40 BULK LIQUID</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl02$ctl00','')" style="width: 130px;">Lubricant (Solvent)</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl02$ctl00','')" style="width: 250px;">WD-40 COMPANY</td><td style="width: 27px;"> <!--<asp:ImageButton ID="ImageButtonWorkArea" Height="27px" ImageUrl="~/Images/close-48x48.png" CommandName="AddtoWorkArea" />--> <a href="#"><img class="addAssessmentImage" src="/Images/close-48x48.png" alt="add assessment" height="27"></a> <!--.addAssessmentImage--> </td><td style="width: 27px;"> <input name="ctl00$ContentPlaceHolder1$GridView2$ctl02$ImageButton1" id="ctl00_ContentPlaceHolder1_GridView2_ctl02_ImageButton1" src="Images/delete-48x48.png" style="border-width: 0px; height: 27px;" type="image"> </td> </tr><tr style="text-decoration: none;" onmouseover="javascript:setMouseOverColor(this);" onmouseout="javascript:setMouseOutColor(this);"> <td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl03$ctl00','')" style="background-color: Red; width: 50px;">1947</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl03$ctl00','')" style="width: 210px;">LUBRICANT GEL</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl03$ctl00','')" style="width: 130px;">Lubricant</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl03$ctl00','')" style="width: 250px;">DURAPIPE GLYNWED PLASTICS LTD</td><td style="width: 27px;"> <!--<asp:ImageButton ID="ImageButtonWorkArea" Height="27px" ImageUrl="~/Images/close-48x48.png" CommandName="AddtoWorkArea" />--> <a href="#"><img class="addAssessmentImage" src="/Images/close-48x48.png" alt="add assessment" height="27"></a> <!--.addAssessmentImage--> </td><td style="width: 27px;"> <input name="ctl00$ContentPlaceHolder1$GridView2$ctl03$ImageButton1" id="ctl00_ContentPlaceHolder1_GridView2_ctl03_ImageButton1" src="Images/delete-48x48.png" style="border-width: 0px; height: 27px;" type="image"> </td> </tr><tr style="text-decoration: none;" onmouseover="javascript:setMouseOverColor(this);" onmouseout="javascript:setMouseOutColor(this);"> <td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl04$ctl00','')" style="background-color: Red; width: 50px;">159171</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl04$ctl00','')" style="width: 210px;">MOTEX STEAM CLEAN DETERGENT</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl04$ctl00','')" style="width: 130px;">Detergent</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl04$ctl00','')" style="width: 250px;">JAYGRADE LTD.</td><td style="width: 27px;"> <!--<asp:ImageButton ID="ImageButtonWorkArea" Height="27px" ImageUrl="~/Images/close-48x48.png" CommandName="AddtoWorkArea" />--> <a href="#"><img class="addAssessmentImage" src="/Images/close-48x48.png" alt="add assessment" height="27"></a> <!--.addAssessmentImage--> </td><td style="width: 27px;"> <input name="ctl00$ContentPlaceHolder1$GridView2$ctl04$ImageButton1" id="ctl00_ContentPlaceHolder1_GridView2_ctl04_ImageButton1" src="Images/delete-48x48.png" style="border-width: 0px; height: 27px;" type="image"> </td> </tr><tr style="text-decoration: none;" onmouseover="javascript:setMouseOverColor(this);" onmouseout="javascript:setMouseOutColor(this);"> <td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl05$ctl00','')" style="background-color: Red; width: 50px;">154903</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl05$ctl00','')" style="width: 210px;">EASY FINISH</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl05$ctl00','')" style="width: 130px;">Aerosol</td><td onclick="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView2$ctl05$ctl00','')" style="width: 250px;">ADVANCED ENGINEERING LTD.</td><td style="width: 27px;"> <!--<asp:ImageButton ID="ImageButtonWorkArea" Height="27px" ImageUrl="~/Images/close-48x48.png" CommandName="AddtoWorkArea" />--> <a href="#"><img class="addAssessmentImage" src="/Images/close-48x48.png" alt="add assessment" height="27"></a> <!--.addAssessmentImage--> </td><td style="width: 27px;"> <input name="ctl00$ContentPlaceHolder1$GridView2$ctl05$ImageButton1" id="ctl00_ContentPlaceHolder1_GridView2_ctl05_ImageButton1" src="Images/delete-48x48.png" style="border-width: 0px; height: 27px;" type="image"> </td> </tr> </tbody></table>
  9. I have the following line: mysql_query("INSERT INTO results (user, movie, input, prediction, error) VALUES('" . $_POST['email'] '" , "' . $Movies[$m]['title'] . '","' . $Movies[$m]["rating"] . '","' . $result . '","' . $err . "' ) ") or die(mysql_error()); However I'm getting mixed up with the opening and closing of "'", can you please have a look?
  10. This is the HTML output of my php script. Can you understand why each time I reload the page - the checked radio button moves along one? <html> <head><title>Realtime Collaborative Filtering</title> <form name="myform" action="result.php" method="POST"> <table border="1"> Enter your e-mail address: <input type="text" name="email"> <tr><td>Dragon Ball - Fortun Teller Baba Saga</td><td>1<input type='radio' name='Dragon Ball - Fortun Teller Baba Saga' value='1' >2<input type='radio' name='Dragon Ball - Fortun Teller Baba Saga' value='2' checked />3<input type='radio' name='Dragon Ball - Fortun Teller Baba Saga' value='3' >4<input type='radio' name='Dragon Ball - Fortun Teller Baba Saga' value='4' >5<input type='radio' name='Dragon Ball - Fortun Teller Baba Saga' value='5' ></td></tr><tr><td>Dune</td><td>1<input type='radio' name='Dune' value='1' >2<input type='radio' name='Dune' value='2' >3<input type='radio' name='Dune' value='3' >4<input type='radio' name='Dune' value='4' >5<input type='radio' name='Dune' value='5' checked /></td></tr><tr><td>Felicity - Season 2</td><td>1<input type='radio' name='Felicity - Season 2' value='1' >2<input type='radio' name='Felicity - Season 2' value='2' checked />3<input type='radio' name='Felicity - Season 2' value='3' >4<input type='radio' name='Felicity - Season 2' value='4' >5<input type='radio' name='Felicity - Season 2' value='5' ></td></tr><tr><td>Freddy Got Fingered</td><td>1<input type='radio' name='Freddy Got Fingered' value='1' >2<input type='radio' name='Freddy Got Fingered' value='2' >3<input type='radio' name='Freddy Got Fingered' value='3' checked />4<input type='radio' name='Freddy Got Fingered' value='4' >5<input type='radio' name='Freddy Got Fingered' value='5' ></td></tr><tr><td>I Heart Huckabees</td><td>1<input type='radio' name='I Heart Huckabees' value='1' >2<input type='radio' name='I Heart Huckabees' value='2' >3<input type='radio' name='I Heart Huckabees' value='3' >4<input type='radio' name='I Heart Huckabees' value='4' >5<input type='radio' name='I Heart Huckabees' value='5' checked /></td></tr><tr><td>Lost in Translation</td><td>1<input type='radio' name='Lost in Translation' value='1' >2<input type='radio' name='Lost in Translation' value='2' >3<input type='radio' name='Lost in Translation' value='3' >4<input type='radio' name='Lost in Translation' value='4' >5<input type='radio' name='Lost in Translation' value='5' checked /></td></tr><tr><td>Pearl Harbor</td><td>1<input type='radio' name='Pearl Harbor' value='1' >2<input type='radio' name='Pearl Harbor' value='2' >3<input type='radio' name='Pearl Harbor' value='3' checked />4<input type='radio' name='Pearl Harbor' value='4' >5<input type='radio' name='Pearl Harbor' value='5' ></td></tr><tr><td>The Royal Tenenbaums</td><td>1<input type='radio' name='The Royal Tenenbaums' value='1' >2<input type='radio' name='The Royal Tenenbaums' value='2' >3<input type='radio' name='The Royal Tenenbaums' value='3' >4<input type='radio' name='The Royal Tenenbaums' value='4' >5<input type='radio' name='The Royal Tenenbaums' value='5' checked /></td></tr><tr><td>The Wedding Planner</td><td>1<input type='radio' name='The Wedding Planner' value='1' >2<input type='radio' name='The Wedding Planner' value='2' checked />3<input type='radio' name='The Wedding Planner' value='3' >4<input type='radio' name='The Wedding Planner' value='4' >5<input type='radio' name='The Wedding Planner' value='5' ></td></tr><tr><td>VeggieTales - Heroes of the Bible</td><td>1<input type='radio' name='VeggieTales - Heroes of the Bible' value='1' >2<input type='radio' name='VeggieTales - Heroes of the Bible' value='2' checked />3<input type='radio' name='VeggieTales - Heroes of the Bible' value='3' >4<input type='radio' name='VeggieTales - Heroes of the Bible' value='4' >5<input type='radio' name='VeggieTales - Heroes of the Bible' value='5' ></td></tr><input type="submit"> </form> </html>
  11. Yes I have done that - and just checked again... But I think the problem is I AM breaking out of the if(statement) however I ALSO need to break out of the foreach (only if that if statement was true). Hope you understand me :-)
  12. Yea sorry it was in there (promise lol) I've just replaced it with the comment.
  13. Please see the following code - I need to break out of the code if the if statement fires, I've tried break but it doesn't seem to do anything. foreach($_POST as $var => $value) { echo "Array title: " . $Movies[$movieno]["title"] . "<br />"; echo "Post value: " . str_replace('_', ' ', $var) . "<br />"; if($Movies[$movieno]["title"] = str_replace('_', ' ', $var)) { $Movies[$movieno]["rating"] = $value; //need to break outta here! } }
  14. Hi, when I am receive any values from POST any spaces are swapped with underscores (_) as such: Dragon_Ball_-_Fortun_Teller_Baba_Saga However I would like to be able to compare this to: Dragon Ball - Fortun Teller Baba Saga So therefore how would I go about removing all of the underscores in order to provide a comparison?
×
×
  • 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.