web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Validation Web Form Po...
Power Pages
Answered

Validation Web Form Power Portal

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey, I tried to set up a validation upon submitting my web form, it succeeded when i made the condition with value, however when i used variable, it fails. Anyone has any idea why? Thank you in advance!

byansakura_0-1599632297898.png

 

Categories:
I have the same question (0)
  • justinburch Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    When you say it succeeded with values, do you mean you hard-coded them?

    Is this wrapped in a "document.ready" to make sure the form has loaded everything?
    If you take the function from the validatorfunction and run it in your dev console (F12 of browser), what is the result? If you check the .val() of each jquery query, what are the values?

  • Verified answer
    H V Profile Picture
    1,510 on at

    Hi @Anonymous 

     

    Variable names might be create an issue because you have added variable name same as field name.

    Please try below code or change the variable name:

    var cr898_filltokenData = $("#cr898_filltoken").val();
    var cr898_tokenData = $("#cr898_token").val();
    if(cr898_filltokenData != cr898_tokenData )
    {
    	return false;
    }
    else
    {
    	return true;
    }

     

    --------------------------
    If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 36

#2
Valantis Profile Picture

Valantis 30

#3
omkarsupreme Profile Picture

omkarsupreme 23

Last 30 days Overall leaderboard