User Profile

Collapse

Profile Sidebar

Collapse
moho
moho
Last Activity: Jun 15 '07, 11:18 AM
Joined: Mar 13 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • moho
    replied to Problem Debugging javascript/Ajax
    just a tip: you can do xxx += zzzzz, saves some space
    See more | Go to post

    Leave a comment:


  • moho
    replied to Event fires wrong input field
    not sure if I got you correct, I just added this to the button
    Code:
    if(event.currentTarget==event.originalTarget)
    that worked fine
    See more | Go to post

    Leave a comment:


  • moho
    started a topic Event fires wrong input field

    Event fires wrong input field

    Hi, I'm having problems with a form, when pressing enter in any field, it fires an event as if I would press a button. when I check in Firebug it shows me that the currentTarget is the button.

    How can I change this strange behaviour?
    See more | Go to post

  • input field in movable div looses select behaviour

    Hi I've started to create movable divs with forms in them. When your grab
    the div you can move it. The bad thing is that you actually can move the form when having the cursor in the one of the input fields. To remove this behaviour I remove the event listener that is attached to the div.
    The problem then is that I loose the normal input functionality for selecting text.

    Anybody knows how to solve this problem?
    ...
    See more | Go to post

  • moho
    replied to loading form dynamically doesn't work
    solved the problem, the code was ok, the problem was that the empty form was loaded twice (after populating it)
    See more | Go to post

    Leave a comment:


  • I tried an different approach, I forgot to say that it was in html so probably that's why there where problems. with () inside a function call.
    See more | Go to post

    Leave a comment:


  • moho
    started a topic passing function with argument to function?

    passing function with argument to function?

    Hi I'm getting some errors, xxx is not a function.

    I'm sending a function as an argument to a funtion:
    Code:
    function s(x)
    {
     ....
    }
    
    function t(a,b,c)
    {
     .......
    }
    
    When passing s into t I get the error s is not a function
    [CODE]
    t(y,ys,s('45'))
    or 
    t (y,ys,s(45))


    [/CODE]
    See more | Go to post

  • moho
    replied to how to set value for a hidden field
    var x = document.getEle mentById('the_h idden_id');
    x.value = xxxx;
    See more | Go to post

    Leave a comment:


  • moho
    replied to loading form dynamically doesn't work
    actually when accessing the page on a old computer I see that the list is populated but then blanked when exiting the loop.
    See more | Go to post

    Leave a comment:


  • moho
    replied to loading form dynamically doesn't work
    sorry for the code, I use a lot of functions and they are all in separate js files
    that are included before the body tag

    What I've found out is that:

    Code:
    alert(intothis.options.length); //var intothis = document.getElementById("sk")
    alert(document.getElementById("sk").options.length);
    gives different answers after code execution:
    the first alert gives 8...
    See more | Go to post

    Leave a comment:


  • moho
    started a topic loading form dynamically doesn't work

    loading form dynamically doesn't work

    Hi

    I'm trying to load a form into a div (that's hidden and then set to visible) = the form gets a page and stores it inside.
    I activate it by pressing a button.

    Then the div will fill in some values in the form elements that it has.
    however this doesn't work.
    the page is loaded but document.getEle mentById doesn't find it. When I look in
    the HTML it's all there.

    Code:
    	var
    ...
    See more | Go to post

  • moho
    replied to Dynamic table creation - table row index
    1 check the parentNode of the selectbox, probably a td
    2 check it's parent,
    3 get the row then use the rowIndex....
    See more | Go to post

    Leave a comment:


  • moho
    started a topic Alert "fixing" problems?

    Alert "fixing" problems?

    Hi, I've been struggling with AJAX for a while and notice that if I add the alert("xxx")
    in my code it always makes the code work.

    I'm using divs where I put the output from the server and then handling the info from there. Sometimes the JS doesn't find the newly inserted tags (divs with id), only when I add the alert command before it. It's kind of strange. Aswell as when enabling FireBug. So I guess that FireBug...
    See more | Go to post

  • thanks for the link, however it didn't really help.

    made it work but I'm not really sure why it works now. added onclick on the button, still submit the form. maybe it was because the form was empty that it didn't do anything. added onclick on the button and action, but like I said, I have no clue why.
    See more | Go to post

    Leave a comment:


  • Javascript mailto - neither subject or body ends in the mail (FF?)

    Hi, I tried to do this:

    Code:
    mailstr = "mailto:recipient@domain.com?subject=subjecextract&body=assg";
    
    	mailform = document.getElementById("mailform");
    	mailform.setAttribute('action',mailstr);
    	mailform.submit();
    However the mail only shows the recipient and not the rest of the values.
    Anybody knows what I do wrong or is it only Firefox?
    See more | Go to post

  • moho
    started a topic variables in javascript or as $_SESSION?

    variables in javascript or as $_SESSION?

    Hi I'm trying to use $_SESSION in my AJAX application.
    However this gives me strange data, the $_SESSION variable seems to
    change during page load. in the end of the page it's the earlier value that shows.

    I set the $_SESSION[id] with this
    Code:
    function setId(id)
    {
    	try{
    	var obj;
    	obj  = document.getElementById("sid");
    	var serverPage = "setid.php" + "?id="+id;
    ...
    See more | Go to post

  • moho
    replied to join query with transpose in MySQL?
    I have two queries that I want to join. But not in the normal way since i only want one row per id. I would like to use the row for creating a list.

    what I've tried to show is the result from the queries so that you might understand my problem.
    See more | Go to post

    Leave a comment:


  • moho
    started a topic join query with transpose in MySQL?

    join query with transpose in MySQL?

    Hi

    I'm wondering how to make these questions:
    Code:
    SELECT * FROM skills WHERE skill='5' AND skill='4'
    | id  | skill | level |
      3  |   5    | 1
      3  |   4    | 1
      4  |   5    | 2
      4  |   4    | 1
      1  |   5    | 1
    Code:
    SELECT Id, skill*level as total, SUM(level) as rating FROM skills WHERE skill='5' OR skill='4' GROUP BY Id ORDER BY rating
    ...
    See more | Go to post

  • moho
    replied to Ajax (php) list submission problem
    I'm sorry: the options are added with javascript:

    Code:
    function setskills(thevalue, id)
    {
    	var already = false;
    	try{
    	theObj = document.getElementById("skills");
    	var optn = document.createElement("OPTION");
    	optn.text = thevalue;
    	optn.value = id;
    	
    	for(i=0; i<theObj.options.length; i++)
    	{
    		if(theObj.options[i].value == id)
    ...
    See more | Go to post

    Leave a comment:


  • moho
    replied to Ajax (php) list submission problem
    added this to getvalues but I cant get the info in $_POST['skills[0]']:

    Code:
    		if(fobj.elements[i].name == "skills")
    		{
    			for(var j=0; j<fobj.elements[i].options.length;j++)
    			{
    				str += fobj.elements[i].name +"[" + j +"]=" + escape(fobj.elements[i].options[j].value)+ "&";
    			}
    		}
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...