HTML form is not validated when I run the url in eclipse browser its not workingHow do you disable browser Autocomplete on web form field / input tag?What are valid values for the id attribute in HTML?HTML form readonly SELECT tag/inputIs it valid to have a html form inside another html form?Is there a W3C valid way to disable autocomplete in a HTML form?Eclipse/Java code completion not workingHTML-encoding lost when attribute read from input fieldHow to get the browser to navigate to URL in JavaScriptHTML button to NOT submit formCannot display HTML string
Male viewpoint in an erotic novel
Golfball Dimples on spaceships (and planes)?
When does order matter in probability?
Project Euler Problem 45
O.5=north.5 (are this the same?)
Is every sentence we write or utter either true or false?
"syntax error near unexpected token" after editing .bashrc
I multiply the source, you (probably) multiply the output!
What is the "Brake to Exit" feature on the Boeing 777X?
Professor refuses to write a recommendation letter to students who haven't written a research paper with him
Compiler optimization of bitwise not operation
Is mountain bike good for long distances?
antimatter annihilation in stars
Why does 8 bit truecolor use only 2 bits for blue?
What is the purpose of the rotating plate in front of the lock?
Is it right to use the ideas of non-winning designers in a design contest?
Can Detect Portal detect a Bag of Holding and other such items?
Can you pop microwave popcorn on a stove?
Why are UK MPs allowed to abstain (but it counts as a no)?
Is Sanskrit really the mother of all languages?
What quests do you need to stop at before you make an enemy of a faction for each faction?
Filling attribute tables with values from the same attribute table
How can I hint that my character isn't real?
Project Euler problem #112
HTML form is not validated when I run the url in eclipse browser its not working
How do you disable browser Autocomplete on web form field / input tag?What are valid values for the id attribute in HTML?HTML form readonly SELECT tag/inputIs it valid to have a html form inside another html form?Is there a W3C valid way to disable autocomplete in a HTML form?Eclipse/Java code completion not workingHTML-encoding lost when attribute read from input fieldHow to get the browser to navigate to URL in JavaScriptHTML button to NOT submit formCannot display HTML string
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have to do a form of validation before submitting the call. The below code works fine when I run the URL in the chrome. But when I execute the same in eclipse as "Run on server"
, the form is not validated. It is taking me to the localhost page. Can you please help me in resolving this. Thanks in advance!
function emptyvalidation(field, errorMessage) field.value == "")
alert(errorMessage);
field.focus();
return false;
else
return true;
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false) nameField.focus(); return false;
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
javascript html eclipse
add a comment |
I have to do a form of validation before submitting the call. The below code works fine when I run the URL in the chrome. But when I execute the same in eclipse as "Run on server"
, the form is not validated. It is taking me to the localhost page. Can you please help me in resolving this. Thanks in advance!
function emptyvalidation(field, errorMessage) field.value == "")
alert(errorMessage);
field.focus();
return false;
else
return true;
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false) nameField.focus(); return false;
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
javascript html eclipse
1
Is it showing any error? andaction ="http://localhost:8080/api/postForm"
why you are using this.
– Mehraj Khan
Mar 28 at 6:19
try to see if there are any error logged in your javascript console.
– Mrak Vladar
Mar 28 at 6:22
@MehrajKhan - That is my rest api call.
– Kutty
Mar 28 at 6:27
@MrakVladar - If the remove the field.focus(), it works fine. But if i add that, it is not working
– Kutty
Mar 28 at 6:28
@Kutty instead offield.focus();
try like this$("#inputBox").focus();
– Mehraj Khan
Mar 28 at 6:38
add a comment |
I have to do a form of validation before submitting the call. The below code works fine when I run the URL in the chrome. But when I execute the same in eclipse as "Run on server"
, the form is not validated. It is taking me to the localhost page. Can you please help me in resolving this. Thanks in advance!
function emptyvalidation(field, errorMessage) field.value == "")
alert(errorMessage);
field.focus();
return false;
else
return true;
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false) nameField.focus(); return false;
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
javascript html eclipse
I have to do a form of validation before submitting the call. The below code works fine when I run the URL in the chrome. But when I execute the same in eclipse as "Run on server"
, the form is not validated. It is taking me to the localhost page. Can you please help me in resolving this. Thanks in advance!
function emptyvalidation(field, errorMessage) field.value == "")
alert(errorMessage);
field.focus();
return false;
else
return true;
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false) nameField.focus(); return false;
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
function emptyvalidation(field, errorMessage) field.value == "")
alert(errorMessage);
field.focus();
return false;
else
return true;
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false) nameField.focus(); return false;
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
function emptyvalidation(field, errorMessage) field.value == "")
alert(errorMessage);
field.focus();
return false;
else
return true;
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false) nameField.focus(); return false;
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
javascript html eclipse
javascript html eclipse
edited Mar 28 at 7:18
Sami Ahmed Siddiqui
1,8751 gold badge9 silver badges20 bronze badges
1,8751 gold badge9 silver badges20 bronze badges
asked Mar 28 at 5:57
KuttyKutty
3851 gold badge2 silver badges17 bronze badges
3851 gold badge2 silver badges17 bronze badges
1
Is it showing any error? andaction ="http://localhost:8080/api/postForm"
why you are using this.
– Mehraj Khan
Mar 28 at 6:19
try to see if there are any error logged in your javascript console.
– Mrak Vladar
Mar 28 at 6:22
@MehrajKhan - That is my rest api call.
– Kutty
Mar 28 at 6:27
@MrakVladar - If the remove the field.focus(), it works fine. But if i add that, it is not working
– Kutty
Mar 28 at 6:28
@Kutty instead offield.focus();
try like this$("#inputBox").focus();
– Mehraj Khan
Mar 28 at 6:38
add a comment |
1
Is it showing any error? andaction ="http://localhost:8080/api/postForm"
why you are using this.
– Mehraj Khan
Mar 28 at 6:19
try to see if there are any error logged in your javascript console.
– Mrak Vladar
Mar 28 at 6:22
@MehrajKhan - That is my rest api call.
– Kutty
Mar 28 at 6:27
@MrakVladar - If the remove the field.focus(), it works fine. But if i add that, it is not working
– Kutty
Mar 28 at 6:28
@Kutty instead offield.focus();
try like this$("#inputBox").focus();
– Mehraj Khan
Mar 28 at 6:38
1
1
Is it showing any error? and
action ="http://localhost:8080/api/postForm"
why you are using this.– Mehraj Khan
Mar 28 at 6:19
Is it showing any error? and
action ="http://localhost:8080/api/postForm"
why you are using this.– Mehraj Khan
Mar 28 at 6:19
try to see if there are any error logged in your javascript console.
– Mrak Vladar
Mar 28 at 6:22
try to see if there are any error logged in your javascript console.
– Mrak Vladar
Mar 28 at 6:22
@MehrajKhan - That is my rest api call.
– Kutty
Mar 28 at 6:27
@MehrajKhan - That is my rest api call.
– Kutty
Mar 28 at 6:27
@MrakVladar - If the remove the field.focus(), it works fine. But if i add that, it is not working
– Kutty
Mar 28 at 6:28
@MrakVladar - If the remove the field.focus(), it works fine. But if i add that, it is not working
– Kutty
Mar 28 at 6:28
@Kutty instead of
field.focus();
try like this $("#inputBox").focus();
– Mehraj Khan
Mar 28 at 6:38
@Kutty instead of
field.focus();
try like this $("#inputBox").focus();
– Mehraj Khan
Mar 28 at 6:38
add a comment |
2 Answers
2
active
oldest
votes
Try removing return in the form tag, and return a status code in your callback function
add a comment |
Try this:
function emptyvalidation(field, errorMessage)
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false)
nameField.focus();
return false;
else
document.getElementById("amform").action = document.getElementById("amform").getAttribute("data-action");
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" data-action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
I have just removed the action URL and inserting it when form gets validated.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391004%2fhtml-form-is-not-validated-when-i-run-the-url-in-eclipse-browser-its-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try removing return in the form tag, and return a status code in your callback function
add a comment |
Try removing return in the form tag, and return a status code in your callback function
add a comment |
Try removing return in the form tag, and return a status code in your callback function
Try removing return in the form tag, and return a status code in your callback function
answered Mar 28 at 6:36
Varun Kumar MedamVarun Kumar Medam
12 bronze badges
12 bronze badges
add a comment |
add a comment |
Try this:
function emptyvalidation(field, errorMessage)
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false)
nameField.focus();
return false;
else
document.getElementById("amform").action = document.getElementById("amform").getAttribute("data-action");
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" data-action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
I have just removed the action URL and inserting it when form gets validated.
add a comment |
Try this:
function emptyvalidation(field, errorMessage)
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false)
nameField.focus();
return false;
else
document.getElementById("amform").action = document.getElementById("amform").getAttribute("data-action");
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" data-action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
I have just removed the action URL and inserting it when form gets validated.
add a comment |
Try this:
function emptyvalidation(field, errorMessage)
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false)
nameField.focus();
return false;
else
document.getElementById("amform").action = document.getElementById("amform").getAttribute("data-action");
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" data-action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
I have just removed the action URL and inserting it when form gets validated.
Try this:
function emptyvalidation(field, errorMessage)
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false)
nameField.focus();
return false;
else
document.getElementById("amform").action = document.getElementById("amform").getAttribute("data-action");
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" data-action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
I have just removed the action URL and inserting it when form gets validated.
function emptyvalidation(field, errorMessage)
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false)
nameField.focus();
return false;
else
document.getElementById("amform").action = document.getElementById("amform").getAttribute("data-action");
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" data-action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
function emptyvalidation(field, errorMessage)
function validateAndSend()
if (emptyvalidation(nameField,"Please enter your Name")==false)
nameField.focus();
return false;
else
document.getElementById("amform").action = document.getElementById("amform").getAttribute("data-action");
document.getElementById("am_submit").disabled = true;
<!DOCTYPE html>
<html>
<div id = "amf" >
<div id = "amTitle" > Enter your form header here </div>
<form onsubmit = "return validateAndSend()" method = "post" target = "_self" name = "amform" id = "amform" data-action ="http://localhost:8080/api/postForm" autocomplete = "off" >
<div style="margin:6px">
<label style="display:inline-block;width:150px;vertical-align:top">Name:</label>
<input type="text" class="inputBox" id="nameField" name="nameField" value="">
</div>
<div style="margin:6px"></div>
<div class = "ambutton" >
<input type = "submit" class = "am_submit" id = "am_submit" value = "Subscribe" >
</div>
</form>
</div>
</html>
answered Mar 28 at 6:47
Sami Ahmed SiddiquiSami Ahmed Siddiqui
1,8751 gold badge9 silver badges20 bronze badges
1,8751 gold badge9 silver badges20 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391004%2fhtml-form-is-not-validated-when-i-run-the-url-in-eclipse-browser-its-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Is it showing any error? and
action ="http://localhost:8080/api/postForm"
why you are using this.– Mehraj Khan
Mar 28 at 6:19
try to see if there are any error logged in your javascript console.
– Mrak Vladar
Mar 28 at 6:22
@MehrajKhan - That is my rest api call.
– Kutty
Mar 28 at 6:27
@MrakVladar - If the remove the field.focus(), it works fine. But if i add that, it is not working
– Kutty
Mar 28 at 6:28
@Kutty instead of
field.focus();
try like this$("#inputBox").focus();
– Mehraj Khan
Mar 28 at 6:38