Results 1 to 2 of 2

Thread: javascript problem

  1. #1
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default javascript problem

    hi qtlers!

    im trying to login with the webview control into this site: http://www.team-ulm.de (german language but it doesnt matter)
    i need to fill out the "Login" field on the left side.

    I tryed that:
    Qt Code:
    1. ui->webView->page()->mainFrame()->evaluateJavaScript("document.getElementById('benutzer').innerText = \"hi\";");
    To copy to clipboard, switch view to plain text mode 

    nothing happens. but when i try

    Qt Code:
    1. ui->webView->page()->mainFrame()->evaluateJavaScript("alert(\"hi\")");
    To copy to clipboard, switch view to plain text mode 

    it works. but it isnt what i want^^

    im working in windows.

    i hope someone can help me..

    ouned

    ps: in visual studio it works like that:

    Qt Code:
    1. webBrowser1.Document.GetElementById("benutzer").InnerText = "hi";
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jun 2008
    Location
    Germany/Belarus/Sweden
    Posts
    53
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: javascript problem

    Qt Code:
    1. <input class="chatfields" type="text" name="benutzer" style="width:78px;" tabindex="1" />
    To copy to clipboard, switch view to plain text mode 

    getElementById need id property of HTML tag, like
    <div id="benutzer"></div>
    and you have name prop.
    name = "benutzer"
    . Try to use getElementByName instead....

Similar Threads

  1. Replies: 19
    Last Post: 3rd April 2009, 23:17
  2. Very strange socket programming problem
    By montylee in forum Qt Programming
    Replies: 5
    Last Post: 11th November 2008, 12:05
  3. deployment problem: msvc++ 2008 Express, Qt 4.4.3
    By vonCZ in forum Qt Programming
    Replies: 7
    Last Post: 10th November 2008, 14:38
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.