Sunday 15 January 2012

function - Using JavaScript/jQuery to decide which hyperlink to use when text is clicked -


I'm still new to javascript and am not sure about syntax or if my thinking is right if someone Can advise how to do that which would be great here What do I have to do, I have a form where a user can either give himself a credit memo number or the system makes one in itself so that Will have two different variables

me Or that when they click on a link, which is built credit memos, they will be sent in a link to one of the variables. If they provide their number then that number should be sent or the number should be sent automatically. After a long time looking through the web I thought it would work but I think I am messing around the syntax or doing it completely wrong. . ('# Credit memo; -

Jave script I'm sure my syntax is incorrect

  $ (' # creditmemolink ') Click on (function () { {If (& amp;) .is (': define')} {var cmnum = document.getElementById (value of 'credit memo') value, on ttUrl = "somepage.cfm creditmemos = # cmnum # & claimID = 9988 ? "; Window.open (.ttrrl," _ blank ");} else {var cmnum = value = document.getElementById ('cmnum');; ttUrl =" somepage.cfm creditmemos = # cmnum # "and claimID Own account "= 9988"; window.open (ttUrl, <_>: none; "class =" txtmedb "& gt; own credit memo: & lt; input type =" text "size =" 25 "name =" credit memo "Id =" credit memo "class =" txtsv "onChange = "CreditMemoText ()" & gt; & nbsp; & amp; nbsp; & lt; cfset cmnum = #htmlEditFormat (GETCLAIM.PO_NBR) # & amp; #TimeFormat (NOW (), "HHMM") # Gt; & lt; cfset cmnum = #cmnum # & amp; #htmlEditFormat (url.claimid) # & gt; & lt; cfset cmnum = # cmnum # & amp; amp; amp; amp; amp;; Chief & gt; & lt; a href = " # "Id =" credmemolink "& gt; The process of making the credit memo test & lt; / A & gt; & Lt; / Div & gt;   

Any advice on how you do this will be very commendable. Having said that I am still new to both coldfusion and java, so still the best way to learn and use syntax is right.

Thank you in advance for your help on this.

Try the code below

  $ ('# creditmemolink' ) .click (function () {{if ($ ('$ creditmemo')) {var num = $ ('# creditmemo'). Val (); // If the user has entered a value, then (if) {} Executes {// user did not provide any input}}});    

No comments:

Post a Comment