Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Abdullah Anwar 36 posts 56 karma points
    May 28, 2015 @ 09:45
    Abdullah Anwar
    0

    Use Javascript function on form field

    Hi

     

    Could you please tell me how can i use the javascript function on umbraco form field.

    I have to use "on blur" and " on focus" function on textfield.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    May 28, 2015 @ 10:37
    Alex Skrypnyk
    0

    Hi Abdullah,

    Do you mean in the Umbraco admin part ?

  • Abdullah Anwar 36 posts 56 karma points
    May 28, 2015 @ 10:47
    Abdullah Anwar
    0

    Alex,

    Thanks for revert but i didn't mean that.

    I have a page with umbraco form.

    In that page i have name and mobile field.

    I want to attach a javascript function on both fields so how can i achieve the same.

    Your help would be appreciated.

     

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    May 28, 2015 @ 10:55
    Alex Skrypnyk
    0

    Hi Abdullah,

    Can you use jquery ? Just found element in the DOM and attach event.

    Thanks

  • Abdullah Anwar 36 posts 56 karma points
    May 28, 2015 @ 11:02
    Abdullah Anwar
    0

    ok, i'll do the same with jquery but can you please guid how can i achieve the following.

    In my name textfield value should be prepopulated like "Name"

    once i click in this field it should hide once i moves out of the field that value should come.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    May 28, 2015 @ 11:04
    Alex Skrypnyk
    0

    Abdullah, maybe you can try to use 'placeholder' attribute? If you need wider browsers support try to use jquery plugin - https://github.com/mathiasbynens/jquery-placeholder

    Thanks, Alex

  • Abdullah Anwar 36 posts 56 karma points
    May 28, 2015 @ 11:09
    Abdullah Anwar
    0
    <input type="text" name="name" placeholder="e.g. John Doe">
    so in this example how can i pass placeholder value since this is mainted by umbraco code and that doesn't ask me the placeholder value.
  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    May 28, 2015 @ 11:40
    Alex Skrypnyk
    0

    What do you mean ?

  • Abdullah Anwar 36 posts 56 karma points
    May 28, 2015 @ 12:21
    Abdullah Anwar
    0
    Once i add a field in umbraco it asks me to enter caption and type of field it doesn't ask me to enter placeholder for that field so how can assign the placeholder value to the umbraco form field
Please Sign in or register to post replies

Write your reply to:

Draft