Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. jesh

    image link

    Try this: http://www.w3schools.com/js/js_animation.asp
  2. jesh

    empty recordset

    If your ProductID is stored in the DB as an int and you are replacing ' with " in the parameter, perhaps your query is coming out like:SELECT ProductID FROM Products WHERE ProductID = "30" When it should be more like: SELECT ProductID FROM Products WHERE ProductID = 30
  3. Yeah, that worked great in my browser. Now, since the number of elements on your form is dynamic (depending on how many times the user clicked one of the "+" buttons), you'll have to iterate through the elements of the form to get at the values. Something along the lines of this?function get_values(){ var count = document.myform.elements.length; for(var i = 0; i < count; i++) { var element= document.myform.elements[i]; if(element.type == "text") { // we're only interested in the text inputs if(element.name.indexOf("announceUrl") > -1) { // this iteration is for the URL // get the value by using "element.value" // and then do whatever you need with it. } else if(element.name.indexOf("announceHeadline") > -1) { // this iteration is for the headline // get the value by using "element.value" // and then do whatever you need with } } } } Hope this helps!
  4. Yea, that's definitely the better solution. To further the suggestion, create a directory called "images" in the same directory where your web page is and put your images in there. Then you can use:<img src="images/fluitengeltje.jpg" alt="dit is een plaatje" />
  5. You should be able to do this using DOM - specifically .createElement(), .appendChild(), .removeChild().Check out the XML DOM and HTML DOM tutorials.
  6. jesh

    space between words

    I don't know that it's possible. If you use "text-align: justify;" and there are words in your paragraph that are much longer than the average word (like in the second paragraph of your example), the only way the browser can make the paragraph justified is to add large gaps between the words.If I'm wrong, and someone else has the answer, I'd love to hear it.
  7. If the height of the yellow box is fixed, you might try CSS positioning: <style type="text/css">#outerdiv{ height: 600px; position: relative; }#innerdiv{ height: 300px; position: absolute; top: 150px; margin: auto;}</style>
  8. Try adding "file:///" in front of your image path: <img src="file:///C:\Documents and Settings\Jan\Mijn documenten\Mijn afbeeldingen\fluitengeltje.jpg" alt="dit is een plaatje">
  9. What about something along the lines of: <script type="text/javascript">// this var will hold all of the window properties.var window_props;// call this on window load or when a user clicks on the link...whichever you preferfunction setWindowProperties(){ var pop_width; var pop_height; var scrollbars; var status; var location; var resize; var toolbar; var directories; var menubar; var status; var left; var top; // get the screen resolution ... // based on the screen resolution, decide what you want the properties to be ... window_props = "height="+pop_height+",width="+pop_width+",scrollbars="+scrollbars; window_props += ",status="+status+",location="+location+",resize="+resize+",toolbar="+toolbar; window_props += ",directories="+directories+",menubar="+menubar",status="+status; window_props += ",left="+left+",top="+top;}function popitup(url){ newwindow = window.open(url, 'name', window_props); if(window.focus) {newwindow.focus();} return false;}</script>
  10. In your original post, you had:if (val = "home"){ ...}else if (val = "about"){ ...} Make sure you use the equality operator "==" rather than the assignment operator "=". if (val == "home"){ ...}else if (val == "about"){ ...}
  11. jesh

    Frame title

    You should be able to use document.title to change the title of your page - each time a frame loads, you could call: <script type="text/javascript"> document.title = "This is the new title of my page!";</script>
  12. The only other thing I can think of for you is to make sure that what you have in the document.write() calls are on the same line and do not span multiple lines: // this should work:document.write("<a href='http://www.refsnesdata.no' target='_blank'>visit refsnes data!</a>");// this may break:document.write("<a href='http://www.refsnesdata.no'target='_blank'>visit refsnes data!</a>")
  13. jesh

    XML parser problem

    Have you looked into using XSL - specifically the "xsl:for-each" element? Check the tutorial - http://www.w3schools.com/xsl/xsl_for_each.asp
  14. jesh

    Uploader?

    Try looking here http://www.w3schools.com/php/php_file_upload.asp. There is a line there that grabs the content-type of the uploaded file: $_FILES["file"]["type"] You could check that value against a list of acceptable file types and decide whether or not you want to save the file or discard it.
  15. jesh

    Confusing SQL query

    Can Access handle multiple SELECTs like SQL Server? If so, this might work for you: SELECT department FROM yourtablename WHERE department NOT IN (SELECT department FROM yourtablename WHERE item_name LIKE 'Geo positioning system')
  16. I copied your code and ran it in Firefox and, like for you, it didn't work. However, I opened the Javascript Console ("Tools -> Javascript Console") and it told me "math is not defined".Turns out that you have to use "Math" rather than "math": var r = Math.random();
  17. You might try setting the left and right margins of the table to "auto" with CSS. If you wanted your table width to be 60% of the containing element and you wanted it centered, you could do something like: <div id="theContainingElement"> <table style="margin: 0px auto; width: 60%;" cellspacing="0"> ... </table></div>
  18. It looks like you are making the AJAX call asyncronously. This means that the script sends off the request through the XMLHTTP object and then continues on its merry way (i.e. submitting the form).Try this instead: ... xmlHttp.open("GET", url, false); ... This should make your script wait for the AJAX request to return before continuing on.
  19. Maybe something like: <script type="text/javascript">function refresh(){ location.href = location.href;}document.onclick = refresh;</script>
  20. I think what is happening is that the "temp" function is being called on the click event of the submit button which fires before the submit event of the form.Rather than having "temp" be called from the onclick and "Validation" on submit, you might try creating a third function that is fired on the submit event of the form: function handleSubmit(){ if(Validation()) { temp(document.forms["cal"]); }}
  21. Good advice, I'll follow it.
  22. To further aspnetguy's answer, many browsers will allow you to use the same ID for HTML elements but it's really bad practice.
  23. Right you are!I wonder if he also changed it from dbcomm.ExecuteReader() to dbcomm.ExecuteNonQuery()? Would a syntax error occur if you attempted to perform an INSERT with a DataReader?At any rate, it's hard to tell unless he posts his actual SQL error.
  24. Did you also add this?dbcomm = New OleDbCommand(sql);
  25. I'm not a VB person, but it looks like you are missing something in your code there. Where are you instantiating dbcomm? You declare it in the first line, but you never instantiate it: Dim dbconn, sql, dbread, dbcommdbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & Server.MapPath("db1.mdb"))dbconn.Open()sql = "INSERT INTO vic (user,pass,name,section,address) VALUES('" & use.Text & "','" & pass.Text & "','" & name.Text & "','" & sec.Text & "','" & adr.Text & "')"// You seem to be missing something like:dbcomm = New OleDbCommand(sql);dbcomm.Connection = dbconn;// Also, I don't think you want to run a reader on an INSERT://dbread = dbcomm.ExecuteReader()//vic.DataSource = dbread//vic.DataBind()//dbread.Close()// ----------------------------------dbcomm.ExecuteNonQuery();dbconn.Close()
×
×
  • Create New...