Jump to content

cve60069

Members
  • Posts

    67
  • Joined

  • Last visited

Posts posted by cve60069

  1. I am wishing to pass two parameters to a function. I wrote a string called HTMLtext and sent this to a modal. Part of the string contains a button that, when clicked, passes two parameters and fires a function that opens another modal. I cannot get it to work. However, if I pass just one parameter, the functions work and the modal opens. I attach two examples written using Notepad. The first is what I wish to achieve but fails; the second works. The section of line that is causing me problems is onclick="doEditAction('+cIndex+','+action+'). I have tried changing it to an arrayed variable and that failed too. Any tips appreciated. Forum question.txt

  2. Hello I am trying to select a cloned div and return its index value and I attach an HTML showing a page that I want to edit. Click on the line and an editor pops out. Create a few lines and the page updates in real-time. Now I want to select a line on the page and get its cloned index. I have written a jquery (last line of code) that returns the index value but it will not work on a cloned div. It always returns 0 Any hints please. I attach the HTML. I wrote it using Notepad. Regards paragraph v2.html

  3. Hello I am working on some javascript routines that will allow me to manipulate local storage. I have created a page that may be edited through a modal-dialogue. I can add a line to the page via the modal but now I want to select a line and work on it (edit, delete, move). The last line of my code '$("div.fItemClass").click(function(event){alert($(this).index())}' is supposed to give me the index of any of the div's I clone but I always get '0'. Any clues please? Regards

    paragraph v2.html

  4. hello I am trying to add a line to a document and edit its contents. I have used jquery clone method (attached). I want to create just one line. i know why I am going wrong but I do not know how to solve. I think it is the ".append($('.item')", This needs to be ".append($('last cloned item')" - maybe. Any hints would be appreciated Regards

    paragraph.html

  5. Hello I have created a form to run in my browser. I fill in some data, Javascript does some math and outputs the results into an HTML document ready for printing. I want to save the input-data and reload it later. How may I save the data, please? I do have apache but I would prefer not to use a server and rely on Javascript only. The data would be for personal use and stored on the local PC. Should I be looking at a Cookie?

  6. Hello I want to dynamically add lines of code into an existing HTML document. I want to create a list of materials but the list is unknown. It could be two or five. I will create the list using Javascript and then insert the list into the HTML document. All of the code below the insertion will move down accordingly. I have seen it done using PHP but I want to do this in my browser. Should I be considering a jquery plugin as a method, similar to WOWslider?. Tutorials, advice or an example would be appreciated. Regards

  7. Hello I want to print a page of text by right-click/print. The page is A4 and I have assumed 72dpi. This gave me a page size of 595 x 842px. I created a <div> with width:595; height:842px and within the <div> I put four other <div> in each corner [A..D] and called the html 'test 1'. The letters are in the four corners. Right-click/print and the letters are not in the four corners. I use CutePDF for my PDF prints but the paper-print confirmed the error. I fudged the page dimensions until I ended with Test 2. The screen is wrong but right-click/print and the page works. Scroll down and see the green letters Please point me in the right direction. Regards

    default 1.css

    test 1.html

    default 2.css

    test 2.html

  8. Hello I have typed my CV in HTML and I want to be able to print it by right-click/print. I have got it to work but I am having to fudge the page-size <div>. A4 is 8.27 x 11.68 inches. I am assuming 72dpi so the size of the <div> would be 595 x 841 pixels. I allow 72px per margin and my CV should print on the page with 1" margins but it doesn't.; I have a 2" left margin and 1.5" right-margin. Do browsers use a different dpi when printing, please? I am printing to CutePDF. Regards

  9. Hello I am wanting to write to a Sync file using the Filesystem API (I am using Chrome) and I cannot get past the first hurdle - creating a file system. I wrote this little prog to develop the functions and I cannot get to the second-alert in the function doFile(). Any tips where I am going wrong, please? Regards <html><head><script type="text/javascript"></script><script>function doFile(){alert("doFile")var fs = requestFileSystemSync(TEMPORARY, 1024*1024);alert()} // end doFile</script></head> <body><input type="button" onclick="doFile()"/></body></html>

  10. All Thanks for the advice. I have it sorted. Did not know I could have a class and an id. <html><head><style> .classRed {background-color:red;} </style><script>function doInput(id){alert(id.value)}</script></head><body> <div>1<input class="classRed" id="iId1" type="text" size="4" onchange="doInput (iId1)"/></div><div>2<input class="classRed" id="iId2" type="text" size="4" onchange="doInput (iId2)"/></div> </body></html>

  11. I attach a script with two input statements. I want the red one but I do not want to declare the colour within the <style> statement but from within the <input> statement or as a global statement from within a style-sheet so that all inputs are coloured. I am designing a form that has many input and select statements and I do not want to have to declare every id as red. Am I able to declare that ALL inputs and selects will be red like in a class statement from within the style-sheet? <html><head><style>#red {background-color:red;)</style><script>function doInput(id){alert(id.value)}</script></head><body><div><input id="red" type="text" size="4" onchange="doInput (red)"/></div><div><input id="iId1" type="text" size="4" onchange="doInput (iId1)"/></div><div><input id="iId2" type="text" size="4" onchange="doInput (iId2)"/></div></body></html>

  12. hello Not sure if this is an HTML or a Javascript problem. I have created a set of input fields (screenshot) for getting dimensions. The arguments passed over to the function "doDimension (dimension,formId)" are tested and assigned values. I want to attach a true value to 'dimension' argument in addition to its numerical value. For example: If the <input> selected was bearing1 and the typed-field was 75; the dimension argument would have the following attributes dimension.id = bearing1 dimension.value = 75 I want to have dimension.visited = true and this attribute would be passed back from the procedure and attached to the id: bearing1. Any clues on creating the attribute would be appreciated. Regards

    post-97381-0-07700900-1344767654_thumb.jpg

  13. The difference between declaring variables in the <head> as opposed to the <body> statement is the value assigned to the variable is undefined in the head but is assigned in the body. put s1 = 2 in the head any alert(s1) gives undefined; put the expression in the body and alert returns 2.

×
×
  • Create New...