How do I revise "if" syntax in form validation JavaScript?

I added a script to my "Contact" page to validate any submitted email. Just one problem: the visitor is not required to give me their reply email if they don't want to. I want the script to validate if they input an email, but do nothing if they leave that form field blank. This should be easy, but as a result of having gotten into the habit of avoiding Web desgn that relies on JavaScript, I don't have the know-how to fix a script when I decide it's needed!  Link:
http://www.keithpurtell.com/kthings/mail02.htm

Just leave the conditional in but have it do nothing...
    if (fld.value == "") {
         // do nothing
    } else if (!emailFilter.test(tfld)) {         //test for illegal characters
        fld.style.background = 'Yellow';
        error = "Please enter a valid email address.\n";
    } else if (fld.value.match(illegalChars)) {
        fld.style.background = 'Yellow';
        error = "The email address contains illegal characters.\n";
    } else {
        fld.style.background = 'White';

Similar Messages

  • DOCTYPE tag above CF's form validation javascript

    Hi,
    CF 8 seems to put the form validation javascript at the very top of the page, even before the HTML tag and the DOCTYPE validation tag.  This is causing problems with my style sheet.  Do you know of a way I can (at the very least), put my DOCTYPE tag above the javscript that CF renders?
    Thank you,
    David
    <script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    Include the head tag, to entice Coldfusion to put the script tags there. Something like this
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><title>test page</title></head>
    <body >
    <cfform>
    </cfform>
    </body>
    </html>

  • How can I direct all my contact form replies (from my website), to my personal email address?

    How can I direct all my contact form replies (from my website), to my personal email address?
    I have embedded the code to my website but would like all of my contact form replies to be directed to my email address. How can I do this by revising the embedded code. Also will I still be able to receive replies after recieving 5000? At this point will I need a premium account?

    Email notifications are a feature of the Basic and Plus account.
    The free account only allows for 50 responses. The Plus (Premium) account allows for 5000.
    Randy

  • How can i disable/hide the calling form from fnd_function.execute

    Hi,
    How can i disable/hide the calling form from fnd_function.execute.If so can any one give the syntax.
    thanks

    Hi Francesco,
    Are you talking about that ??? )) It will explain you about to get the name of the web page when you are executing an abap function for determining the values of variables...
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/g-i/how%20to%20make%20a%20variable%20even%20more%20flexible%20in%20bw-bps.pdf">How to make a variable even more flexible in BW-BPS?</a>
    This is weird: I wrote that document a few weeks ago, it is theorically published on SDN but this is not possible to find it by using the research tool... Maybe because it applies only to BPS in 3.5. I did not have enough time to migrate that solution to BI-IP 7.0.
    Regards
    Laurent

  • How to print page numbers in adobe form

    Hi,
    Can anybody tell me how to print page numbers in adobe form.
    Thanks in advance
    Chaitanya

    Hi,
    Yes the field page n of m is used normally for printing page numbers. But it won't display the current page of total pages by itself. You have to set the run time property to n (current page ) and m (Total number of pages). Carefully select the # (current page ) and ## (Total number of pages). Hope this works for you.
    My requirement is to have the user control on current page. For Example:
    Example for a Invoice with 5 PO items (stands on 2 pages) :
    1st  page is the letter : no page number
    2nd page is the 1st page of the 1st copy of the invoice : we should read u201C1 / 2u201D
    3rd page is the 2nd page of the 1st copy of the invoice : we should read u201C2 / 2u201D
    4th page is the 1st page of the 2nd copy of the invoice : we should read u201C1 / 2u201D
    5th page is the 2nd page of the 2nd copy of the invoice : we should read u201C2 / 2u201D
    Presently i cam getting the current page number for page 4th as 3 / 2 and for 5th page 4 / 2. I could able to control the total number of pages from print program. But when i am printing the second copy (4th and 5th pages), I couldn't able to control the current page number. I need to initialize the Current page count (4th page ) as 1.
    I have used the follwing java scripting:
    this.rawValue = wv_pages - xfa.layout.page(this)
    where wv_pages is total no of pages calculated from print program.
    Please help me in this regard with some formcal or java scripting conditions.
    Thank You,
    Regards,
    Naresh.

  • How to find revision number on my macbook ?

    How to find revision number on my macbook ?

    Wrong question, as there has been no formal revision number issued by Apple. What you may have seen on some postings about revision C, D, etc. is probably no more than rumor.
    You can get some information about the place and date of production of your computer by selecting the "Blue Apple" in your menu bar, then selecting About this Mac. Press More, then look at your serial number.
    My serial number is W8612xxxxx..
    "W8" lists the production location in China.
    "612" means that my MBP was produced in the 12th week of 2006.
    One of the defects in early production runs was a noisy inverter for the LCD screen. It's likely that that was a parts problem that was remedied in progress of production. My "week 12" MBP has no problems at all.
    My MBP runs a bit hot, but within specs. For that matter, I found the TiBook it replaced was uncomfortably warm as a laptop. There's a simple remedy if you want work in laptop mode. Just put something -- a notebook, a rigid plastic sheet a few millimeters thick or the like -- under the MBP and you (and the computer) will be more comfortable.

  • How do I use the vector web forms??

    I'm new to using vector graphics and need to know how to go about using these web forms using Illistrator to make it functional on a web site. I tried opening it with the Illustrator, Fireworks, but not sure how to get the white fields to actually work like a text field. Hotpot will only link to another page which I don't want. I want the user to be able to enter their email address or whatever info is required then be able  to submit. Please help!

    That graphic is for making a wireframe/design. It cannot offer any real form functionality.
    To create a form with that appearance, you will need to wrestle with HTML, CSS, and your choice of scripting languages to process the input.

  • How to get a values from one form to another form

    Hi All,
    I am using oracle forms 10g.
    I have created two forms. First form named as Hotel reservation req and second form named as Hotel Res Summary.
    I the first form i have one field named Requisition_number and I have one button and when i press the button in the first form the summary form is called and it need to bring all the data regarding that requisition_number in first form.
    I have written a query in when button pressed Like this
    declare
    :Global.V_REQ_NO := :XXMBHOTRESREQ_DB.REQUISITION_NO
    type r_cursor is ref cursor;
    c_XXMBHIS r_cursor;
    V_xxmbht XXMB_DOMHTRS_REQ%rowtype;
    begin
    open c_xxmbhis for select * from XXMB_DOMHTRS_REQ where requisition_number=:Global.V_REQ_NO
    loop
    fetch c_xxmbhis into v_xxmbht;
    exit when c_xxmbhis%notfound;
    --dbms_output.put_line (V_XXMBHT.REQUISITION_NUMBER);
    end loop;
    close c_XXMBHIS;
    end;
    And how to refer this to the calling form.
    But now the form is opening and record is not querying can any one correct me where i went wrong.
    Thanks & Regards
    Srikkanth
    Edited by: Srikkanth.M on Aug 19, 2011 6:43 PM

    I the first form i have one field named Requisition_number and I have one button and when i press the button in the first form the summary form is called and it need to bring all the data regarding that requisition_number in first form.If more than 1/4 of your Forms will need the REQUISITION_NUMBER then using a GLOBAL variable makes scense. However, if it is only your Hotel Reservation and Hotel Res Summary forms that will use the REQUISITION_NUMBER then use a Parameter List instead. Global variables are always of type CHAR so you could encounter conversion errors if you don't explicitly cast the value to the correct data type. Parameter object can be of type CHAR, NUMBER and DATE and offer greater flexibility. If you need an example of how to use a parameter list, open the Forms Help system, go to the Search tab and search on "Creating a Parameter List." This article give a brief overview and a list of all the built-ins associated with Parameter Lists. You will need to create a Parameter object in your Hotel Req Summary form to catch the parameter passed via the Parameter List. Then you will need to write code to do something with the value passed (usually in the When-New-Form-Instance trigger).
    Craig...

  • How can I code this in Oracle Forms?

    I have a master-detail form. In the detail block, I have several records. Here is my name table.
    ID Name_Type Name
    1 old Mike
    2 Current John
    3 old Peter
    4 old Andrew
    I would like to create a button trigger which shall perform the following:
    1) insert a record into database with a copy of current value. In the above case it will insert create a record for John as name_type = 'OLD'. So we have total of 5 records. Commit the transaction.
    2) Scroll through my detail records (5) and go to one specific record and erase the values from it. In the above case, it should find John's record with name_type = 'Current' and erase John from it.
    How can I accomplish this in Oracle forms using a button-pressed trigger?

    Hi,
    Simple, using current values you can create new id , 'old' and name so oracle will create record, now refresh block, next using next_record in loop you can find record,erase one and refresh block.
    Adinath Kamode

  • How to improve the performance of adobe forms

    Hi,
    Please give me some suggestions as to how to improve the performance of adobe form?
    Right now when I' am doing user events it is working fine for first 6 or 7 user events. From the next
    one it is hanging.
    I read about Wizard form design approach, how to use the same here.
    Thanks,
    Aravind

    Hi Otto,
    The form is created using HCM forms and processes. I' am performing user events in the form.
    User events will doa round trip, in which form data will be sent to backend SAP system. Processing will
    happen on the ABAP side and result will appear on the form. First 6 or 7 user events works correctly,
    the result is appearing on the form. Around 8 or 9th one, the wait symbol appears and the form is not
    re-rendered. The form is of size 6 pages. The issue is not coming with form of size 1 page.
    I was reading ways to improve performance during re-rendering given below.
    http://www.adobe.com/devnet/livecycle/articles/DynamicInteractiveFormPerformance.pdf
    It talks about wizard form design approach. But in SFP transaction, I am not seeing any kind of wizard.
    Let me know if you need further details.
    Thanks,
    Aravind

  • How do I maintain control of my form?

    This is a bit "wordy", but here is the scoop. I'm using Microsoft Visual
    Studio for VC++ in Windows 2000.
    I made an application which had no form in it. So when I ran the
    application, I just got a DOS box that showed some progress info. I then
    decided to add a form... So I made a new application and started with
    creating the form. Then I copied and pasted cpp code into places where I
    thought they should go - leaving out the stuff that would print to the DOS
    box. Pfff.....
    The program works, but as soon as it gets into the meat of the real
    application, I lose control of the form and can't change things.
    Now... it is very likely that this may be due to the fact that the real
    application is running all over the place and doesn't have time to bother
    with the form - but I really think I should be able to get back to the form
    so I can change things on the fly.
    I should let you know that I'm using an SDK. I've noticed that the form
    creates an area in the .cpp with event handlers - but my application uses
    event handlers involved with the SDK. These event handlers are not active
    until I hit the "Connect" button - and that is when I lose control.
    I'll try to be a little more exact. I'm using the 3d chat - Active Worlds
    SDK. The form takes information from two ini files and loads it. I hit the
    connect button, it connects and the application runs fine - but I have lost
    my form control at that point. Funny thing... before I hit connect - I
    can't close or minimize the form yet I have control of the edit boxes in the
    form and can load and save to ini files - but after I hit connect, the
    minimize and close functions work, yet I can't get to the edit boxes. I
    think the basic code is good - I just got some stuff out of place or I'm
    missing a message somewhere along the way.
    Got any clues?
    Maybe I should have the real application separate
    from the form? As it is right now, the real application is in the form
    ..cpp - the form .cpp does not call up the real application because it is
    already there. I think that is my problem... but I don't know how to run
    another .cpp from the form. I hope I am making sense here... Should I
    study up a bit more on resourcing stuff? Thinking to myself... the form
    should be running in one section of memory - and the application in another.
    When I change the form, the form sends a message to the application and the
    application adjusts itself. As it stands right now, since the main
    application is in the form, the form code is ignored once the connect button
    is hit. If I am correct, or if you have other suggestions, please give me a
    hand here.
    P2

    P2,
    Are you developing an MFC application or a standard Win32 project?  For an MFC application, the project should automatically be set up to handle messages which would respond to your UI interactions.  For a Win32 application, you must ensure that you have a message dispatch loop.  The following link has a good description of the Message Loop:
    http://www.winprog.org/tutorial/message_loop.html
    It may be that you are performing some operation that takes a very long time so the Message Loop handling (either in the MFC or Win32 app) is not being called often enough.  In that case, you must see if it is possible to break up your operations so that the Mesasge Loop is still handled.  A good way to take care of this is to fork a separate thread for the heavy operations to take place in.
    If this is not related to the use of Measurement Studio controls, you may get a better or more detailed answer if you post this question on a generic Windows programming forum.
    Thanks,
    Tyler Tigue
    Applications Engineer
    National Instruments

  • How to call a bean from a form?

    hi all
    i want to write a simple bean that checks the login information (userId ad Password) passed to it by a form in my jsp file.
    so i think i have to call the setUser() and setPassword() methods of my bean in a single action... how to do it?
    I also thought i can do it by calling a JavaScript, by I dont know how....
    then, once i get the boolean value (logged) returned from my bean, i can (through jsp) redirect the logged user to another page, or send a message to the non-logged user.
    is it a good solution or should I do it with a servlet?
    thanx for your answers
    sandro

    u can do it using a servlet or JSP itself. Check the sample code below to see how u can validate using values from form
    <%
    String username=request.getString("frmUser");
    String password=request.getString("frmPassword");
    urBean userBean = new urBean(); //Creating instance of ur bean class.
    userBean.setUserName(username); //Setting username
    userBean.setPassword(password); //Setting password
    boolean flag = userBean.validate(); //This functions validates against a database.
    if(flag) {
    response.sendRedirect("loggedin.jsp"); //redirects to page on successfull login
    }else{
    response.sendRedirect("error.jsp"); //redirects to error page.
    %>
    Hope this helps
    Biju

  • How to return a html repsonse after form guide rendering in browser?

    How to return a html repsonse after form guide rendering in browser indicating that server has recieved transmission and request is submitted succesfuly?
    I am rendering the form guide in browser using guide invoke service and when i submit the data in browser to server through guide , it is displaying some random number in browser?
    i need to display a resposne that request is submitted successfully?

    how could i define a variable with "html data" ?
    Create a variable of type document and then a service to read the html from where ever it's located. If you put it in LiveCycle, you can use the ReadRessource service. If it's on the file system, you can use the Read Document. If it's in the database, you can use the JDBC service.
    Also, one more doubt where should i use this variable in my process to get the same?
    You want the response once you've submitted the data, so the html is really the result of calling the process that's processing the data. So I would create an output variable of type document on that process.
    Right now it displays a random number in the browser because your submit process is long lived. When a process is long lived (asynchronous), you invoke it and then you get an identifier back. It's kind of a fire and forget. You can use that identifier to check the status of the long lived process, since long lived processes can take hours, days to complete. You don't want your browser to wait that long, hence the identifier.
    However if you change the process to be short lived (synchronous), the browser will wait for the result of the process, which really means the output variables for that process. If your output variable contains html, it'll display html.
    So the key is make you submit process short lived and populate the output variables appropriately.
    Jasmin

  • How to Show BI report in adf form ?

    How to show bi Report in adf form ?
    (i dont show dashboard in adf form

    Hi,
    check this : http://husaindalal.blogspot.com/2009/11/integrating-bi-publisher-standalone.html
    there are some other helpful links as well:
    http://brendenanstey.blogspot.com/2007/01/adf-faces-and-xml-publisher-success.html
    http://technology.amis.nl/blog/2296/building-a-report-in-xml-publisher
    http://technology.amis.nl/blog/1597/xml-publisher-display-input-parameter-sqllims
    ~Abhijit

  • How to print the contents of a form(window)

    I'm devloping visitors application in java. After the data entry, I need to display the selected information from database along with the photo and take a printout so that it looks like a card.
    I know how to display the contents in a form. How do I print the contents of the form?
    -Thanx
    Hane

    in JComponent there is a method called print(Graphics g)
    you can use that with a Printable class
    read bout the java.print package in the java doc

Maybe you are looking for