Current Code Always Supplies A True Result Even If No Data Is Put In These Fields?

Oct 11, 2011

'm trying to put together some code within a form that tests whether someone has supplied an email address or a telephone number when the Submit button is pressed. Neither of these fields are require mandatory input.Trouble is my current code always supplies a true result even if no data is put in these fields i.e. the 1st IF statement returns true. What am I doing wrong?Here's my code.
_____
<script type="text/javascript">
function check_id() {
if (document.feedback.email !="" || document.feedback.tel !="") {[code].........

View 2 Replies


ADVERTISEMENT

If One Textfield Out Of The Three Has A Value Result = True

Feb 19, 2010

I have this little script working great when all if's are seperated. what i need is to have the script read if one of these fields has a value then result=true. as you see the script now i have this seperated in many different if's for all three text fields. I need to put all text fields like they were one,

[Code]....

View 5 Replies View Related

JQuery :: Calling Validate Function On Button And Getting The Result (true/false)

Feb 10, 2011

I am trying to do following task:

$("#btn1").click(function(){
var success = $("#myFrm").validate();
if (success == true) {
// post form through ajax

[Code]....

View 1 Replies View Related

JQuery :: Filer A Data Which Test Is True?

May 20, 2011

if I got set a data like

$('a.test').data('test', true)

How to filer a data which test is true?

View 1 Replies View Related

Checkbox - Code 'if (nameFieldString.checked==true ){' Is Not Working

Jun 12, 2011

I'm trying to learn programming in JS by making some programs.

I have made a form:

With the next js code I will check which checkbox is selected:

The code 'if (nameFieldString.checked==true ){' is not working .

View 1 Replies View Related

AJAX :: Populate Text Fields According To MySQL/PHP Result?

Sep 4, 2010

I am absolutely newbie to Ajax and I need to have this fixed by tomorrow as I have a project to complete so anyone

[Code]...

View 4 Replies View Related

JQuery :: Online Booking System For Office Supplies And Our Client ?

Dec 10, 2009

I'm working on a online booking system for office supplies and our client as the following requirement:

He would like to book a item from for example 12.december to 24.december. It also should be possible to book a item only for 2 hours on a day. For example 10 to 12pm!

There are some appendage todo this...

I would like to use jqry datepicker but the datepicker has no "hourview" or? (two-level)

View 1 Replies View Related

Passing Current Value Of Fields Into Dynamic Dropdown?

Sep 27, 2010

So i have a form with fields (30+), and about 5 of them are fields that need to pass into my dropdown (actually a dynmaic dropdown, select SOURCE, then whatever source u select it'll show options that are mysql source=$source), so it can go into my mysql query, and filter out the best results. (i.e date_of_birth, min_credits, state, etc). Needs to be done without submitting, hence javascript. Im echo'ing my query and its saying the variables i'm trying to pass are UNDEFINED. Am I not passing the vars correctly? do i need to prep the vars to "grab" them in the current field?

this is what i have in my <head>
<script language="javascript" type="text/javascript">
function getXMLHTTP() { //fuction to return the xml http object
var xmlhttp=false;

[Code].....

The only var that is passing is SOURCE, and that's because its the name of the first dropdown

i need to set up like a GET method on my RECEIVING page? or can i just pass variables through? Do i need to get the "existing" data in the fields first?

View 3 Replies View Related

Passing Current Value Of Fields To MYSQL Dropdown

Sep 27, 2010

i have a form with fields (30+), and about 5 of them are fields that need to pass into my dropdown (actually a dynmaic dropdown, select SOURCE, then whatever source u select it'll show options that are mysql source=$source), so it can go into my mysql query, and filter out the best results. (i.e date_of_birth, min_credits, state, etc). Needs to be done without submitting, hence javascript. Im echo'ing my query and its saying the variables i'm trying to pass are UNDEFINED. Am I not passing the vars correctly? do i need to prep the vars to "grab" them in the current field?

[Code]...

View 1 Replies View Related

Jquery :: When The PHP Done With Checking Data Echo The Result ('1' Or '0')?

Jun 16, 2011

Jquery code looks like:

$('#gal').rating('gl.php?gal_no=<?=$gal_no;?>&id=<?=$id;?>', {maxvalue:10,increment:.5, curvalue: <?=$cur;?>});
PHP code:

[code].....

View 10 Replies View Related

Dynamically Add New File Field Below The Current Fields When The Button Is Click?

Apr 9, 2011

I new this is not to hard but I forgot on how to do it.I have this form:

<form><table><tr>
<td>Add Picture:</td>
<td colspan="3"><input name="txtPics" type="file" /></td>

[code]....

View 1 Replies View Related

Using JS Code Then Different JS Code On The First Result?

Apr 21, 2010

I will apologise in advance, as I am an absolute novice with JS, and this may be hard to explain, but hoping someone can shed some light on a weird problem we are having at the mo with some new functionality on our site.Basically we have a page which uses some JS code found online to show a products shipping cost, depending by country chosen. This all works well, and the correct shipping amount is shown dynamically as a single amount (in JPN YEN) depending which country is selected from the drop down list.

We also have some other JS which converts any price shown on our site from JPN YEN (which is what the whole site works in) to whichever currency the user chooses. So lets keep it GBP for the example.So the user would select their shipping country, and for example the shipping price would show as (this is in JPN YEN):18,400Even though the price is shown dynamically, the JS is set to output between a span which is how the next bit of JS shows the conversion. i.e<span id="yccConvert">18,400</span>Thi 2nd bit of JS then sees this figure between the span and outputs the shipping figure to:But this will not work in FF or Chrome at all. IE works fine (7 and 8 tested).

As the initial bit of JS generates the price dynamically, it doesn't actually put the figure in the source code between the span, even though it displays it as though it does on the screen (the style of the span is applied and the correct price layout is shown, apart from FF and Chrome that is).We are thinking that this may not be working as it is doing one bit of JS, then doing another bit of JS on the result of the first bit. Does that make sense? Maybe a delay is required so that the first bit of JS can do its job, then the 2nd bit does its part.

View 1 Replies View Related

JQuery :: Ajax Post - Accessing Return Data / Result Variable

Nov 30, 2010

So I'm currently working on a ASP.NET Webforms site and I've run in to a small problem. On my .cs file I have the following Webmethod

[WebMethod]
public static string IsJobEditable(int jobid){
try{
string isEditable = "false";
JobsBLL jbl = new JobsBLL();
int jobStatusId = jbl.GetJobStatusId(jobid);
//If the jobs is either waiting or being edited it is
okay to edit it
if(jobStatusId ==
Convert.ToInt32(ConstantsUtil.JobStatus.Waiting) || jobStatusId ==
Convert.ToInt32(ConstantsUtil.JobStatus.Edit)){
isEditable = "true";
}return isEditable;
}catch (Exception ex){
throw ex;
}}

This function in this case will ALWAYS return TRUE as a string. On Aspx page I have the following
$(function () {
$.ajax({
type: "POST",
url: "Coordination.aspx/IsJobEditable",
data: "{jobid:" + jobid + "}",
contentType: "application/json; charset=utf-8",
dataType: "text",
success: function (result) {
alert(result);

//This is written out in the alert {"d":"true"}
I want this in a variable as a string so I can do a check on it before I do some other actions. The format is not a String so I cannot split on it to retrieve the "true" part.
},
error: function (err, result) { alert(err); }
});});

As you can see in the comments the value I get back in the Callback method is in to me a weird format. The type is unknown and I need this value to be able to proceed with my entire method surrounding the small portion of the Javascript. Where to access the result variable / data as a var or anything else that will let me put it into a var (as a string).

View 1 Replies View Related

JQuery :: Autocomplete Parse Method Documentation - Data - Value And Result Name/value Pairs

May 4, 2010

Using the [url]. I am not able to find the documentation on usage of parse option in [url]

How to add details like what goes into data,value and result name/value pairs and when to use it.

View 3 Replies View Related

JQuery :: .support.cors = True Only Allow Certain Domain - Load The Exact Same Json Data From Other Domain Or Localhost

Jan 4, 2012

I am doing some development using jQuery $.getJson lately and found the following weird scenario.

1. open google chrome without any argument then load a local html file.

2. the local html file will need to have $.getJson[url] .... bla bla bla and jQuery.support.cors = true.

3. data will get loaded

But if you try to load the exact same json data from other domain or localhost, it wouldn't works.

View 1 Replies View Related

JQuery :: Browser Cache And Notmodified Respond For JSON - .ajax({ifModified:true}) Break On Data Respond

Feb 28, 2011

How to fix browser cache and notmodified respond for JSON? jQuery.aja ({ifModified:true}) break on data respond (bug ticked for it was closed like invalid).

Are there any other solution to get 304:notmodified without breaking cache and data respond?

First time browser request [url] returns status 200 OK and nexts 304 Not Modified

XHR first time returns ok:

But on next times returns data undefined:

How to solve it? Expected result:

View 3 Replies View Related

Code That Will Check The Current Browser And Then Use A Different Background Image Accordingly?

Aug 30, 2010

I'm looking for a JS code that will check the current browser and then use a different background image accordingly.Mainly for browsers like Flock and etc. that aren't yet CSS3 friendly (background-size:cover; etc.)I'm not looking for an alternative to CSS3, because, well, I like it! Just a way to check if the current browser is CSS3 friendly.[EDIT]I just started reading an article about Object Detection ttp://www.quirksmode.org/js/support.html). Seems like a better alternative to browser detection. However, how do I use JS to check if the browser supports a CSS3 statement???

View 1 Replies View Related

Ajax :: Adding Data To Current Page And Removing Old

Sep 15, 2011

I've been learning a lot about jscript and PHP while I've been building my site...now I'm curious about using a little ajax. I have an internal email setup on my site where users can contact one-another...when you click on Inbox, Sent, Drafts, ect it calls a php script and reloads the page. I'm considering for my next release, doing this with jscript but my question is this...

When I print info to the page that I'm on, how hard is it to get rid of the old data that was there? This might be the easiest thing in the world but i don't even know what to call this on google. Also, if that's the norm, how hard is it to add data to a page with out getting rid of whats already there? I've been reading about ajax and I've been using jscripts to check my forms and do simple things but I'm really interested in learning what I really have the power to do here...

View 5 Replies View Related

JQuery :: Implementing Transitions Into My Current Hide() Show() Code?

Aug 23, 2011

Im developing a site for my company that will contain relevant information on sites we serve (such as login details, passwords, addresses etc). It is available locally on our intranet due to the fact we have login details and such.

Anyway on the sidebar of my site (which is run on Wordpress), I have all the sections for the sites.

When a user clicks item #1, it expands and shows all the sites in that area.

The one problem is that when the sections are clicked on, they just expand in a very plain boring way.

I need it so that there is some sort of smooth transition between opening and closing the <div> sections.

Here is the current code I have now (I tried to edit as much of the comments as possible so it will make sense):

<script>

I found it on google, and modified it without having to change anything on the sidebar itself, just a simple paste to the head section.

This code also hides other currently open sections, so that only one may stay open at a time.

View 1 Replies View Related

JQuery :: Saving Current HTML Code Source To File?

Oct 26, 2009

I'm new to js/jquery and this forum so please forgive my potentially off-scope js/jquery remarks. I've been running a lot of toggles to show, hide, etc... divs and other HTML elements. It's making my application incredibly nice navigation wise.

Now to put myself in my users shoes. Say one user toggles on and off the things they want and don't want until they are satisfied with all the content of the screen. (That is by the way the nature of my application. A user loads in various variables via PHP and other means and when satisfied, a PDF is generated for them containing all their preferred content.)

Because: When a user is at a point where all the content they are viewing is worthy of a PDF, it is also worth saving that HTML 'view' (classes switched, variable adjusted, etc...). I would call it 'Save this workspace' or something along those lines.

I don't have a direct question per se but am more interested in the views of others who have similar thoughts and moreover, what relationship has jQuery had in helping employing some method?

View 4 Replies View Related

Adding Textbox Numbers - Sum The Two Textbox Fields And Have Result Show In The Total Textbox

Mar 22, 2011

Below is the script and form fields I am working with. What I want to do is sum the two textbox fields and have the result show in the total textbox. The code works fine and the total textbox is updated with the value of form1.basic. The problem occurs when I add the "+ parseInt(document.form2.supporter.value)" code in the script section.

View 8 Replies View Related

JQuery :: Access The Index Of The Json Data Array In The Current Iteration And Use It In A Template?

Jun 21, 2011

is it possible to access the index of the json data array in the current iteration and use it in a template?

View 2 Replies View Related

Instant Search - Code - Show Result String On The Search Field

Dec 13, 2011

I found this for instant search :

demo : [url]

index.php

Now i just want to edit one thing, when you search for something, results are shown under the search field, when you click on each result, goes to a link.

I want when clicking on a result, not going to link, just show that result string on the search field. where should i edit in script?

View 3 Replies View Related

Add Data From Dynamic Fields To Mysql Db In Php?

Oct 24, 2009

i have a script which i found on the internet. i modify that script according to my needs. what is in that script is there are three form fields with two buttons. one button is "Give me more fields" clicking on this button will give you more fields. and second button is submit so the data goes to server side and will be added to db. the problem is when i click give me more fields it gives me three more fields which is right but when i fill all these fields and click submit button it adds to the db but the data in the first three fields adds in the one row and the other three fields data adds in separate row which is not fine for me. so how can i do this so all the data will be added to only one row.

here is js code

Code:

var counter = 0;
//Start a counter. Yes, at 0
function add_phone() {
counter++;

[Code]....

View 1 Replies View Related

Copy Data Between Form Fields

Oct 24, 2011

I have 2 types of addresses

1. Permanent address > Postal code, Street, City, State, Country

2. Current address > Postal code, Street, City, State, Country

And a check box 'Copy from Permanent address' with Current address

When i checked that check box then all values from 'Permanent address' will be copy to 'Current address'

View 4 Replies View Related

Keep The Valid Data After Validating The Fields?

Aug 16, 2010

iam trying to do a form with some validation on it and when the user enter an invalid entry the validation alert the invalid message and every thing works fine the problem is : after hitting okay button all the previous data entered in the fields is no longer exist so the user enter every thing again how do i keep he valid entry for the user in the fields

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved