Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to check if javascript element id exist?
Forum Updated to NodeBB v4.3 + New Features

How to check if javascript element id exist?

Scheduled Pinned Locked Moved Solved General and Desktop
1 Posts 1 Posters 386 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nicholaslee
    wrote on 16 Jul 2018, 10:27 last edited by
    #1
    if (ui->webView->page()->mainFrame()->evaluateJavaScript(QString("document.getElementById('ContentPlaceHolder1_ErrorTextLabel').value"))!=null)
            {
    }
    

    I want to make a function that does commands whenever the user makes an invalid log in. So I made a getElementById such that whenever the error text label exist, i can carry out other commands but qt is giving me the error ['null' was not declared in this scope]
    Is it a syntax or declaration error?
    Anyone can help me with this? Thanks!

    1 Reply Last reply
    0

    1/1

    16 Jul 2018, 10:27

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved