Error in form submit through netui:anchor tag onClick event

Hello,
I am working on a portal application. Below is my jsp code of a simple search screen. The search parameter is customername.
<netui:form action="searchCustomer" style="form" tagId="myForm">
<netui:textBox dataSource="{actionForm.customerName}"></netui:textBox>
<netui:anchor onClick="sayHello(); return false;" styleClass="button" action="searchCustomer" formSubmit="true"> Search</netui:anchor>
</netui:form>
I have an onClick event as I want to implement some customer logic on click of the anchor tag.
function sayHello(){
// customer implementation here
document.forms[getNetuiTagName("myForm",this)].method="POST";
document.forms[getNetuiTagName("myForm",this)].action="/searchCustomer.do";
document.forms[getNetuiTagName("myForm",this)].submit();
In the searchCustomer method of the controller, the form has zero parameters. The customerName has null value.
Can anyone tell me what am I doing wrong here.
Any help is appreciated.
Thanks
Manju

I also want to add a confirm() dialog before submitting. However, setting the onClick handler overrides the one generated when formSubmit="true". I worked around this by calling the generated function directly:
<... onClick="if (confirm('[msg]')) { anchor_submit_form(getNetuiTagName('[formName]'), this.href) } return false;">
Where [msg] is the message to display and [formName] is the name of the form containing the anchor.
Hope this helps someone.

Similar Messages

  • Netui anchor tag in netui:form

    I have some code like following:
    <netui:form action="action1" >
    <netui:anchor action="action2">Check</netui:anchor>
    </netui:form>
    Action1 and action2 willl be finally redirected to the same JSP(for example one.jsp).
    The weird thing is that: according to log output, it seems that one.jsp has been hit twice when user click "check" link.
    Is it possible that when user click "check" link, weblogic not only trigger action2 but also trigger action1? forsubmit attribute is not set to true explicitly for netui:anchor tag.
    Thanks in advance

    hi
    verify from a browser trace tool (e.g. livehttpheaders, fiddler or firebug) how many requests your browser is making. (or you can inspect the code that portal generates in the HTML). Once we have determined whether its the browser making the two requests or something on the server, we can see if there are workarounds.
    regards
    deepak

  • Netui: anchor tag with target attribute.

    I am using the netui:anchor tag inside an iframe to post to an action. But the
    resulting page is displayed within the iframe. Will the target attribute of the
    netui:anchor tag help solve the problem. What is a valid value of the target
    attribute.
    thanks,
    Shankar

    does the action have a formSubmit = true? If not then your modal dialog should be shown via the onclick and you have to javascript the link click (based on your modal dialog options)
    If you do have a formSubmit=true, then you'd have the onclick show the modal dialog and you would have to write additional javascript to submit the form (Along with setting its action)
    regards
    deepak

  • Netui Anchor Tag

    Can we use href and action attribute in netui:anchor tag both at a time...*href* is for opening a modal dialog and action is page flow action

    does the action have a formSubmit = true? If not then your modal dialog should be shown via the onclick and you have to javascript the link click (based on your modal dialog options)
    If you do have a formSubmit=true, then you'd have the onclick show the modal dialog and you would have to write additional javascript to submit the form (Along with setting its action)
    regards
    deepak

  • Problem in onClick attribute of the netui:anchor tag

    Hi,
    I have a String object to be passed to the javascript function with onClick attribute.
    eg: <%String st = new String("helo");%>
    <netui:anchor action="display" onClick="display()">
    I want to pass the object st to the java script so that I can do some validations. how can I do that. If I say,
    onClick="display('<%=st%>')" it is not working. can you please suggest me a solution.
    Regards,
    Satish.

    I haven't tried this with the netui:anchor tag, but it works with the netui:button tag.
    <%
    String onCl = "display('" + st + "')";
    %>
    <netui:anchor action="display" onClick="<%=onCl%>">
    Apparently, you can place a scriptlet inside the onClick attribute, but you cannot intermingle the scriptlet with plain text.
    Also, the onclick attribute appears not to support XScript ({request.whatever}). I find that weird.

  • Extending netui Anchor tag

    Has anyone extended netui anchor tag and created custom tag?
    I am considering writing a custom pagination tag extending the anchor tag.
    Appreciate any suggestions ..sample code
    Thanks

    Just need to provide a caveat with extending the 8.1 NetUI JSP tags...
    Unfortunately, the Workshop 8.1 JSP tags did not provide a supported extensibility API. If the 8.1 JSP tags are extended, BEA / Workshop do not make any guarantees about the forward compatibility of these APIs in future releases. A NetUI JSP tag API will be available in the 9.2 GA release of Apache Beehive, which will be included in Workshop 9.2.
    Hope that helps...
    Eddie

  • Please debug my javascript (error with form.submit())

    help!! help!! i have used form.submit() where form = document.forms[0] but this time it gives me an error, please help, i will give you $10
    <html>
    <head>
    <script>
    <!--
    var sw;//switch
    sw=true;//default true
    var str;//string used if invalid data
    //validates all required form fields
    function validate(form){
    sw=true;//default true
    str="The following errors occurred while processing...\n";
    form = document.forms[0];
    //check name
    if(isWhitespace(form.fullName.value)){
    str += "-You must enter your Full Name\n";
    sw=false;
    }else
    if(!isAlphabetic(form.fullName.value)){
    str += "-Your Full Name must consist of only letters\n";
    sw=false;
    //check company name
    if(isWhitespace(form.compName.value)){
    str += "-You must enter your Company Name\n";
    sw=false;
    //check address
    if(isWhitespace(form.add1.value)){
    str += "-You must enter your Address\n";
    sw=false;
    //check city
    if(isWhitespace(form.city.value)){
    str += "-You must enter your City\n";
    sw=false;
    //check state
    if(isWhitespace(form.state.value)){
    str += "-You must enter your State\n";
    sw=false;
    //check zip
    if(isWhitespace(form.zip.value)){
    str += "-You must enter your Zip Code\n";
    sw=false;
    }else
    if(!isZIPCode(form.zip.value)){
    str += "-Your Zip Code must be digits only\n";
    sw=false;
    //check email
    if(isWhitespace(form.email.value)){
    str += "-You must enter your E-Mail\n";
    sw=false;
    }else
    if(!isEmail(form.email.value)){
    str += "-You must have a valid E-Mail address\n";
    sw=false;
    //check dayPhoneNumber
    if(isWhitespace(form.dayPhone.value)){
    str += "-You must enter your Day Time Phone Number\n";
    sw=false;
    }else
    if(form.dayPhone.value.length < 10 || form.dayPhone.value.length > 14 )
    str += "-You must enter a valid Day Time Phone Number (XXX)XXX-XXXX\n";
    sw=false;
    //check evePhoneNumber
    if(isWhitespace(form.evePhone.value)){
    str += "-You must enter your Evening Phone Number\n";
    sw=false;
    }else
    if(form.evePhone.value.length < 10 || form.evePhone.value.length > 14 )
    str += "-You must enter a valid Evening Phone Number (XXX)XXX-XXXX\n";
    sw=false;
    if(sw)
    form.submit();
    else
    alert(str);
    }//end validate
    // whitespace characters
    var whitespace = " \t\n\r";
    // non-digit characters which are allowed in ZIP Codes
    var ZIPCodeDelimiters = "-";
    // our preferred delimiter for reformatting ZIP Codes
    var ZIPCodeDelimeter = "-";
    // U.S. ZIP codes have 5 or 9 digits.
    // They are formatted as 12345 or 12345-6789.
    var digitsInZIPCode1 = 5;
    var digitsInZIPCode2 = 9;
    var defaultEmptyOK = false;
    // Returns true if string s is empty or
    // whitespace characters only.
    function isWhitespace (s)
    {   var i;
    // Is s empty?
    if (isEmpty(s)) return true;
    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.
    for (i = 0; i < s.length; i++)
    // Check that current character isn't whitespace.
    var c = s.charAt(i);
    if (whitespace.indexOf(c) == -1) return false;
    // All characters are whitespace.
    return true;
    // Check whether string s is empty.
    function isEmpty(s)
    {   return ((s == null) || (s.length == 0))
    // isAlphabetic (STRING s [, BOOLEAN emptyOK])
    // Returns true if string s is English letters
    // (A .. Z, a..z) only.
    // For explanation of optional argument emptyOK,
    // see comments of function isInteger.
    // NOTE: Need i18n version to support European characters.
    // This could be tricky due to different character
    // sets and orderings for various languages and platforms.
    function isAlphabetic (s)
    {   var i;
    if (isEmpty(s))
    if (isAlphabetic.arguments.length == 1) return defaultEmptyOK;
    else return (isAlphabetic.arguments[1] == true);
    // Search through string's characters one by one
    // until we find a non-alphabetic character.
    // When we do, return false; if we don't, return true.
    for (i = 0; i < s.length; i++)
    // Check that current character is letter.
    var c = s.charAt(i);
    if (!isLetter(c))
    return false;
    // All characters are letters.
    return true;
    // Returns true if character c is an English letter
    // (A .. Z, a..z).
    // NOTE: Need i18n version to support European characters.
    // This could be tricky due to different character
    // sets and orderings for various languages and platforms.
    function isLetter (c)
    {   return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
    // isZIPCode (STRING s [, BOOLEAN emptyOK])
    // isZIPCode returns true if string s is a valid
    // U.S. ZIP code. Must be 5 or 9 digits only.
    // NOTE: Strip out any delimiters (spaces, hyphens, etc.)
    // from string s before calling this function.
    // For explanation of optional argument emptyOK,
    // see comments of function isInteger.
    function isZIPCode (s)
    {  if (isEmpty(s))
    if (isZIPCode.arguments.length == 1) return defaultEmptyOK;
    else return (isZIPCode.arguments[1] == true);
    return (isInteger(s) &&
    ((s.length == digitsInZIPCode1) ||
    (s.length == digitsInZIPCode2)))
    // isEmail (STRING s [, BOOLEAN emptyOK])
    // Email address must be of form [email protected] -- in other words:
    // * there must be at least one character before the @
    // * there must be at least one character before and after the .
    // * the characters @ and . are both required
    // For explanation of optional argument emptyOK,
    // see comments of function isInteger.
    function isEmail (s)
    {   if (isEmpty(s))
    if (isEmail.arguments.length == 1) return defaultEmptyOK;
    else return (isEmail.arguments[1] == true);
    // is s whitespace?
    if (isWhitespace(s)) return false;
    // there must be >= 1 character before @, so we
    // start looking at character position 1
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;
    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;
    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
    // isInteger (STRING s [, BOOLEAN emptyOK])
    // Returns true if all characters in string s are numbers.
    // Accepts non-signed integers only. Does not accept floating
    // point, exponential notation, etc.
    // We don't use parseInt because that would accept a string
    // with trailing non-numeric characters.
    // By default, returns defaultEmptyOK if s is empty.
    // There is an optional second argument called emptyOK.
    // emptyOK is used to override for a single function call
    // the default behavior which is specified globally by
    // defaultEmptyOK.
    // If emptyOK is false (or any value other than true),
    // the function will return false if s is empty.
    // If emptyOK is true, the function will return true if s is empty.
    // EXAMPLE FUNCTION CALL: RESULT:
    // isInteger ("5") true
    // isInteger ("") defaultEmptyOK
    // isInteger ("-5") false
    // isInteger ("", true) true
    // isInteger ("", false) false
    // isInteger ("5", false) true
    function isInteger (s)
    {   var i;
    if (isEmpty(s))
    if (isInteger.arguments.length == 1) return defaultEmptyOK;
    else return (isInteger.arguments[1] == true);
    // Search through string's characters one by one
    // until we find a non-numeric character.
    // When we do, return false; if we don't, return true.
    for (i = 0; i < s.length; i++)
    // Check that current character is number.
    var c = s.charAt(i);
    if (!isDigit(c)) return false;
    // All characters are numbers.
    return true;
    // Returns true if character c is a digit
    // (0 .. 9).
    function isDigit (c)
    {   return ((c >= "0") && (c <= "9"))
    //-->
    </script>
    <body>
    <form method="post" enctype="text/plain" action="mailto:[email protected]">
    <table border="0" bgcolor="yellow">
    <tr>
    <td width="150">Name*</td>
    <td width="250"><input type="text" size="30" maxlength="60" name="fullName"></td>
    </tr>
    <tr>
    <td width="150">Company Name*</td>
    <td width="250"><input type="text" size="30" maxlength="50" name="compName"></td>
    </tr>
    <tr>
    <td width="150">Address- Line1* </td>
    <td width="250"><input type="text" size="30" maxlength="50" name="add1"></td>
    </tr>
    <tr>
    <td width="150">Address- Line 2</td>
    <td width="250"><input type="text" size="30" maxlength="50" name="add2"></td>
    </tr>
    <tr>
    <td width="150">City*</td>
    <td width="250"><input type="text" size="15" maxlength="30" name="city"></td>
    </tr>
    <tr>
    <td width="150">State*</td>
    <td width="250"><input type="text" size="10" maxlength="25" name="state"></td>
    </tr>
    <tr>
    <td width="150">Zip Code*</td>
    <td width="250"><input type="text" size="5" maxlength="10" name="zip"></td>
    </tr>
    <tr>
    <td width="150">E-mail*</td>
    <td width="250"><input type="text" size="30" maxlength="50" name="email"></td>
    </tr>
    <tr>
    <td width="150">Day Phone*</td>
    <td width="250"><input type="text" size="15" maxlength="25" name="dayPhone"></td>
    </tr>
    <tr>
    <td width="150">Evening Phone*</td>
    <td width="250"><input type="text" size="15" maxlength="25" name="evePhone"></td>
    </tr>
    <tr>
    <td width="150">Fax Number</td>
    <td width="250"><input type="text" size="15" maxlength="25" name="fax"></td>
    </tr>
    </table>
    <br>
    <table>
    <tr><td><input type="button" value="next" size="20" name="submit" onClick="validate(this.form)"></td></tr>
    </table>
    </form>
    </body>
    </html>

    With this changes your program works:
    function validate(){
    if(sw)
    return true;
    else {
    alert(str);
    return false;}
    <form method="post" enctype="text/plain" action="mailto:[email protected]" onSubmit:"return validate()">
    <tr><td><input type="submit" value="next" size="20" name="submit"></td></tr>
    (also, note that you should advice that you need 5 digits in the ZIP field.
    Fill the field with 3 digits to see what I mean).
    �am �am duke duke duke :) dollarssss

  • Output of netui:anchor - 1563

    Hello,
    I have a requirement, where I need to pass the output generated by netui:anchor
    to a javascript. Basically I need to capture an portlet action url along with
    the portal desktop and sendit to mailto functionality. I tried using the id attribute
    of the netui:anchor tag and unfortunately it is not working. The id is set to
    null by the tag.
    Is there a way to capture a porlet's action url?
    Thanks for your help.
    Senthil Kumar.S

    Nevermind. I solved it.
    Thanks
    Kunal
    "Kunal Mittal" <[email protected]> wrote:
    >
    I have my WebLogic Server running on port 7110. There are several places
    where
    I use the netui:anchor tag to generate links and form submit. However,
    the url
    that gets generated in the html output (I did a view source in IE to
    see this),
    all have 7001 as the port instead of 7110.
    Thanks
    Kunal

  • Netui:anchor generates port as 7001 instead of another port

    Hi...
    I have my WebLogic Server running on port 7110. There are several places where
    I use the netui:anchor tag to generate links and form submit. However, the url
    that gets generated in the html output (I did a view source in IE to see this),
    all have 7001 as the port instead of 7110.
    Any clues?
    Thanks
    Kunal

    There should be an xml file in your web-apps WEB-INF dir called something like
    url-template-config.xml which has server settings like port number etc. I believe
    this is used to generate URLs for page flows etc.
    "Troy Hamsher" <[email protected]> wrote:
    >
    So... how did you figure this out?
    "Kunal Mittal" <[email protected]> wrote:
    Never mind. I figured this out.
    Kunal
    "Kunal Mittal" <[email protected]> wrote:
    Hi...
    I have my WebLogic Server running on port 7110. There are several places
    where
    I use the netui:anchor tag to generate links and form submit. However,
    the url
    that gets generated in the html output (I did a view source in IE to
    see this),
    all have 7001 as the port instead of 7110.
    Thanks
    Kunal

  • Title attribute for netui:anchor

    Does anybody know how to set an title on a <netui:anchor> tag? I can't see anyway
    of doing this from the documentation.
    As of Oct 04 this will be illegal in Europe when the Disability Discrimaination
    Act legislation comes into effect.
    Many Thanks
    Tony

    There's not a way to do that currently. This is a bug that will be fixed in
    the next version.
    Rich
    "Tony Cromarty" <[email protected]> wrote in message
    news:400c0e2a$[email protected]..
    >
    Does anybody know how to set an title on a <netui:anchor> tag? I can't seeanyway
    of doing this from the documentation.
    As of Oct 04 this will be illegal in Europe when the DisabilityDiscrimaination
    Act legislation comes into effect.
    Many Thanks
    Tony

  • Netui:anchor

    Hi,
    I want to open a link(Fr eg www.yahoo.com) in a new browser window.I am using netui:anchor tag but a not able to display the link in the new page.A popup window opens but the url doesnt load.
    <netui:anchor href="${container.item.urlName}" popup="true">${container.item.urlName}
    <netui:configurePopup width="500" height="500"/>
    </netui:anchor>
    Please let me know how this can be done.
    Thanks in advance.
    Sri

    Maybe a <netui:parameter/> in the <netui:anchor/> would do the trick. In
    your action, you could check for a request parameter to determine where
    it come from.
    gerry rodman wrote:
    Lets say that I have two netui:anchor's that transfer control to the same action
    method in a page flow. How can I pass a paramter to the pageflow (upong clicking
    the anchor) to detect which anchor was clicked?
    thx
    gr

  • Form bean with int property and netui:select tag

    Hi,
    I've recently started using WebLogic 8.1 for a client project. There's
    been a bit of a learning curve, but I've been able to find most of my
    answers in the docs or on the dev2dev site. This one, though, I've been
    unable to manage.
    I have a database table, call it foo. In it I have columns for id
    (numeric) and name (string). I created a database control to read that
    data:
    select id, name
    from foo
    I then want to use this data to populate a select list in a form, which
    is going to be used to submit new records for another table. For the data:
    id     name
    1     Foo
    2     Bar
    3     Bletch
    I want to generate a select list (this is the output HTML, not the netui
    tags):
    <select name="foo">
    <option value="1">Foo</option>
    <option value="2">Bar</option>
    <option value="3">Bletch</option>
    </select>
    My first question is what the best way to do this is. I was able to get
    this working by creating a database control, which returns an array of a
    custom Foo class. I then pass that array into a utility method which
    converts it into a Map, and pass that map to the netui:select tag in the
    optionDataSource attribute. This works, but it seems rather roundabout,
    so I'm wondering if there's a better way to do it, without needing the
    conversion utility method in the middle. I tried playing around with
    the control, I tried using different netui tags (I thought I could do it
    with a repeater and netui:selectOption tags, but that didn't work), and
    nothing else worked.
    The second problem arose when I was tying the result to a Form Bean. I
    created a bean with all the data that I was reading from the form, and
    at first, I just made everything in the form bean be a String. For this
    select, though, the values are ids, so I thought I'd just make them be
    ints in the form bean instead. However, when I did that, WL decided
    that it wanted to add in a default option with a value of 0:
    <select name="foo">
    <option value="1">Foo</option>
    <option value="2">Bar</option>
    <option value="3">Bletch</option>
    <option value="0" selected>0</option>
    </select>
    I've tried to find a way to get rid of that 0, and I can't. Is there a
    way to prevent it from sticking in a default value like that? Or do I
    have to just leave it as a String in the form bean to get it to work the
    way I want?
    Thanks in advance for your help.
    Joe Robins                    Tel: 212-918-5057
    Thaumaturgix, Inc.               Fax: 212-918-5001
    19 W. 44th St., Suite 810          Email: [email protected]
    New York, NY 10036               http://www.tgix.com
    thau'ma-tur-gy, n. the working of miracles.

    wrt your 2nd problem, in the jpf, for the form bean, are you declaring your id
    like this:
    private int id;
    if so, try declaring it w/ a valid value, like:
    private int id = 1;
    -tanya
    Joe Robins <[email protected]> wrote:
    Hi,
    I've recently started using WebLogic 8.1 for a client project. There's
    been a bit of a learning curve, but I've been able to find most of my
    answers in the docs or on the dev2dev site. This one, though, I've been
    unable to manage.
    I have a database table, call it foo. In it I have columns for id
    (numeric) and name (string). I created a database control to read that
    data:
    select id, name
    from foo
    I then want to use this data to populate a select list in a form, which
    is going to be used to submit new records for another table. For the
    data:
    id     name
    1     Foo
    2     Bar
    3     Bletch
    I want to generate a select list (this is the output HTML, not the netui
    tags):
    <select name="foo">
    <option value="1">Foo</option>
    <option value="2">Bar</option>
    <option value="3">Bletch</option>
    </select>
    My first question is what the best way to do this is. I was able to
    get
    this working by creating a database control, which returns an array of
    a
    custom Foo class. I then pass that array into a utility method which
    converts it into a Map, and pass that map to the netui:select tag in
    the
    optionDataSource attribute. This works, but it seems rather roundabout,
    so I'm wondering if there's a better way to do it, without needing the
    conversion utility method in the middle. I tried playing around with
    the control, I tried using different netui tags (I thought I could do
    it
    with a repeater and netui:selectOption tags, but that didn't work), and
    nothing else worked.
    The second problem arose when I was tying the result to a Form Bean.
    I
    created a bean with all the data that I was reading from the form, and
    at first, I just made everything in the form bean be a String. For this
    select, though, the values are ids, so I thought I'd just make them be
    ints in the form bean instead. However, when I did that, WL decided
    that it wanted to add in a default option with a value of 0:
    <select name="foo">
    <option value="1">Foo</option>
    <option value="2">Bar</option>
    <option value="3">Bletch</option>
    <option value="0" selected>0</option>
    </select>
    I've tried to find a way to get rid of that 0, and I can't. Is there
    a
    way to prevent it from sticking in a default value like that? Or do
    I
    have to just leave it as a String in the form bean to get it to work
    the
    way I want?
    Thanks in advance for your help.
    Joe Robins                    Tel: 212-918-5057
    Thaumaturgix, Inc.               Fax: 212-918-5001
    19 W. 44th St., Suite 810          Email: [email protected]
    New York, NY 10036               http://www.tgix.com
    thau'ma-tur-gy, n. the working of miracles.

  • Anchor tag error, also copy and pasting text comes up "null"

    After the recent update I am receiving anchor tag errors telling me to start with an alphabetic letter, which I was. Also no longer lets me copy and paste text onto a page, instead it says "null". Any ideas on a fix ?

    I don't see a closing </body> tag in your code.  There's an opening tag, but no closing tag, hence unbalanced.
    ^_^

  • How to add anchor tag dynamically on infopath (OOTB task form of workflow .xsn) by jquery -dynamically as i did by below script on newform.aspx where I will read Help title and URL value from list

    on newform.aspx just above the top of cancel button I want to put 1 hyperlink "Help"
    but I want to do this by script/jquery by reading my configuration list where 1 column is TITLE and other is- URL
    Configuration List has 2 columns Title and URLValue
    Title                                    UrlValue
    HelpNewPage                    
    http://url1
    HelpEditPage                      http://url2
    so script should read Title and display "Help"--->1st part on NewForm.aspx/EditForm
    Script should read UrlValue column and on click of help-(display link) the respective url should be open in new window.-->second part
    Please let me know reference code for adding anchor tag dynamically by reading from list
    Help/Reference 
    http://www.sharepointhillbilly.com/Lists/Posts/Post.aspx?ID=5
    I can see hyperlink near cancel button-
    //This block is just placing help link near cancel button- 
    $(document).ready(function() {
        GetHelpLinkFromConfigList();
    var HelpLinkhtml ='<a href="#" text="Help">Help</a>';
    var position =$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    var HelpLinkhtml ='<a href="#" text="Help" onclick="GetHelpLinkFromConfigList();">Help</a>'; 
    var position =$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    var HelpLinkimageButton ='<IMG SRC="../../Style Library/Help.bmp" style="width:35px;"/>'; 
    var position1 =$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkimageButton );
    //Rest script
    function GetHelpLinkFromConfigList()
     //The Web Service method we are calling, to read list items we use 'GetListItems'
     var method = "GetListItems";
     //The display name of the list we are reading data from
     var list = "configurationList";
     //We need to identify the fields we want to return. In this instance, we want the Title,Value fields
     //from the Configuration List. You can see here that we are using the internal field names.
     var fieldsToRead = "<ViewFields>"+"<FieldRef Name='Title' />"+"<FieldRef Name='Value' />"+"</ViewFields>";
     //comment
     var query = "<Query>" +
                            "<Where>" +
                                "<Neq>" +
                                    "<FieldRef Name='Title'/><Value Type='Text'>Help</Value>"
    +
                                "</Neq>" +
                            "</Where>" +
                            "<OrderBy>" +
                                "<FieldRef Name='Title'/>" +
                            "</OrderBy>" +
                        "</Query>";
     $().SPServices(
     operation: method,
        async: false,
        listName: list,
        CAMLViewFields: fieldsToRead,
        CAMLQuery: query,
        completefunc: function (xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var displayname = ($(this).attr("ows_Title"));
        var UrlValue = ($(this).attr("ows_Value")).split(",")[0];
        AddRowToSharepointTable(displayname,UrlValue)
    function AddRowToSharepointTable(displayname,UrlValue)
        $("#NDRTable").append("<tr align='Middle'>" +
                                    "<td><a href='" +UrlValue+ "'>+displayname+</a></td>"
    +
                                   "</tr>");
    <table id="NDRTable"></table>
    sudhanshu sharma Do good and cast it into river :)

    Hi,
    From your description, you want to add a help link(read data from other list) into new form page.
    The following code for your reference:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(AddHelpLink, "sp.js");
    function AddHelpLink() {
    var context = new SP.ClientContext.get_current();
    var list= context.get_web().get_lists().getByTitle("configurationList");
    var camlQuery= new SP.CamlQuery();
    camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>Help</Value></Eq></Where></Query></View>");
    this.listItems = list.getItems(camlQuery);
    context.load(this.listItems,'Include(Title,URL)');
    context.executeQueryAsync(function(){
    var ListEnumerator = listItems.getEnumerator();
    while(ListEnumerator.moveNext())
    var currentItem = ListEnumerator.get_current();
    var title=currentItem.get_item("Title");
    var url=currentItem.get_item("URL").get_url();
    var HelpLinkhtml ='<a href="'+url+'">'+title+'</a>';
    $("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    },function(sender,args){
    alert(args.get_message());
    </script>
    Result:
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Apache Sling JCR Resource Resolver doesn't work for the anchor tags which is been rendered through j

    Certainly I realized that Apache Sling JCR Resource Resolver doesn't work for the anchor tags which is been rendered through jquery or javascript.
    e.g.
    In Felix Console , in Apache Sling JCR Resource Resolver configuration I have added following mapping.
    /content/myproject/-/
    So If any anchor tag is there like <a href="/content/myproject/en.html"> click me </a> then it will be mapped to "/en.html" automatically.
    But the problem is there in following scenario.
    I have an anchor tag as follows.
    <a href="#" id="test"> click here </a>
    And I am assigning the href to anchor through JQUERY.
    <script>
    $("#test").attr("href","/content/myproject/en.html");
    </script>
    Ideally this should have been mapped to "/en.html".
    But it is not mapping to "/en.html". It still shows "/content/myproject/en.html".
    How to resolve this.
    Thanks,
    Sai

    In a servlet you have access to the resourceResolver so if you know which attributes contain links then it's relatively easy to apply resourceResolver.map to those links.
    Your challenge is clearly how do you know which attributes are links and which aren't. Its is the same challenge that makes parsing the response and rewriting it on the way out difficult - the JSON doesn't have any semantic meaning so how do identify which attributes require rewriting. There really is no good answer ot that question in my experience - all the options have down sides.
    Create some convention - all attributes matching this pattern X get mapped before being converted to JSON (could be attributes whose name ends in link, or it could a convention applied to the value of the attribute - if the attribute is a string that starts with /content apply the resource resolver mapping. In this case you have train your developers to follow this convention which is the down side.
    Create some configurable list of attribute names that require mapping. This is brittle, requires training and is easy to break.
    Implement a client side version of the resource resolver mapping. It wouldn't be as full proof as server side mapping (because that takes into account but you could make it work for simple logic like stripping of /content/site/en. If ou are just trying to solve the simple version of this issue - stripping off the top of the repository path this might be your best option.
    Not worry about it and set up Apache 301 redirects that catch any long URLs and redirect them to short URLs (so configure apache to look for any URL matching /content/site/en and strip off /content/site/en and do a 301 redirect to the shortened URL. You end up with a lot of extra HTTP request because of all the 301s but it would work (I wouldn't recommend this option - but it is possible).

Maybe you are looking for

  • ETC Spread date ??

    Hi All, Can any one expand ETC Spread date. That is the error I am facing while running concurrent program. thanks

  • Dump error while running tcode

    Hi When i am running my payroll with standard tcode pc00_m10_calc that tcode is going into abap runtime error., I even checked with abap and basis but can able to solve the prob so kindly help me Error in the ABAP Application Program The current ABAP

  • Backup from 11.1.1.3 version

    Hi All, let us know whether the database backup and the restoration process is the same in 9x version and 11.1.1.3 version. Or should we use the LCM facility only for taking the database backup in 11.1.1.3. Thanks in advance

  • Updating a localized StaticTextField within a TiledView

    I have a ViewBean which holds an embedded TiledView and this TiledView has an embedded TiledView. In my last Tiled View I'm updating a StaticTextField object within my nextTile() method. This StaticTextField object is constructed with a ResourceBundl

  • Adjustment Layer modifications do not appear in Actions

    Problem with action in Photoshop CC This problem occurs only on my own computer, on another computer, no problem. If I make an action containing an adjustment layer, for example an adjustment layer curves, it is designed to neatly. I then bring a cha