I am not a web developer. So my question maybe a bit silly.
The scenario is quite simple: there are two text fields for user to input username and email address and one button to click to send the inputs to the server.
Normally there is nothing special, but i check the datagram send to the server by using google chrome's developer tools, and i find there is actually three items: name,email,timestamp. And timestamp is an empty string. Then how can i fill these 3 items by only 2 textfields and also don't know the code?
The server side is a black box. I think what i can do is input somethings to these 2 textfields and click the button. I wonder can i just add something in the second text field to fill the email and the timestamp field together? Or any other techniques i can use?
Any suggestions are appreciated.
P.S.
1.This is just an interesting test. i want to try it out. If success, there should be something come out when click the button. But when i click there is nothing but a warning to let me try to see the datagram. when i check the datagram, i see there is one timestamp which is empty. i guess i should try to fill the timestamp to make it.
2.The request method is POST. Status Code:200 OK
Request Payload {name:XXX,email:XXXXXX,timestamp:}
email:"XXXXXX"
name:"XXX"
timestamp:""
3. The form code is as follows:(i copy by viewing source of the page)
<form class="mt30" id="msgForm">
<input type="text" name="name" placeholder="name" />
<input type="text" name="email" placeholder="email" />
<input type="hidden" name="timestamp" />
<div class="mt30"><button class="btn" id="btnSubmit">open</button></div>
</form>
The following returns the number of milliseconds since the epoch in Js
time_stamp = new Date().getTime();
Just Send It With The Post fileds.
If So And don't No If I Should answer This But :
Go To This Site epochconverter And Copy The current Unix epoch time And Place It In The TextFiled
Related
I need to display the last value of id,in an input form when I open the page of regestration ( befor to add a new user). help me
<input type="text" id="text" value="{{$last_id}}" >
but I don't have any idea about where I have to set this ligne:
$last_id =DB::table('clients')->max('id');
If the purpose of this is to have the right incremented value when you create the client, the database can handle it for you if you wrote your migration the right way. If it's the case, just paste your migration for the clients table and I'll show you the way to do it.
If you just want to display it, you can write it that way, but make sure this is the right way to do what you want to do here :
<input type="text" id="text" value="{{ DB::table('clients')->max('id') }}" >
Let me know if it helped you
So I am trying to make a bookmark in chrome that would input a Javascript code that would fill up a textbox on my router home page. The goal is saving me the hassle of either remembering that silly password or having to open my textfile containing the said password.
I know, I know, ... I am lazy. (but not for learning some Javascript in the process)
The thing is the textbox doesn't have an ID and its name changes on reload so I cannot know its name in advance.
I have looked at a few pages on here that kind of guide me in the right direction but I can not make it work for the life of me as I have little to no experience in Javascript.
Here is what the html of the textbox looks like :
<input type="PASSWORD" style="WIDTH: 150px" name="password_random10digitnumber" value="" size="20" maxlength="64">
Here is what I ended up with as a link on my bookmark (the only thing I tried that doesn't give me an error).
javascript:document.getElementsByTagName("input")[0].value='myrouterpwd'
Currently, when I press my bookmark, it refreshes the page and shows a blank page with "myrouterpwd" on it.
(There is two other input html blocks on the page which are :
<input type="HIDDEN" name="md5_pass" value="">
<input type="HIDDEN" name="auth_key" value="numbersIamnotsureIshouldshowtheworld">
)
Thank you to anybody taking the time to answer!
I haven't worked much with bookmarks and am assuming that because it's a bookmark, you are navigating away from the page that you actually want to work with. So, I'm not sure that triggering this that way is a viable solution. Of course, you could just take advantage of the browser's ability to store passwords for you. ;)
But, to the main point of your question... Assuming that it's the only password field on the page, the use of element.querySelector() will find it:
// Get a reference to the right element based on its type attribute value
let passwordBox = document.querySelector("input[type='password']");
passwordBox.value = "MySecretPassword"; // Populate the field
console.log(passwordBox.value); // Confirmation
[type='password'] { background:yellow; } /* Just so you know which box is the password box */
<input type="hidden" name="doesntMatter">
<input name="someTextBox">
<input type="password" name="doesntMatter2">
<input name="someOtherTextbox">
I have researched stackoverflow and other sources for many weeks for an answer to this question but have not been able to uncover an answer. I appreciate that there may be other posts that indirectly deal with the topic, but nothing seems to address the requirements of the specific example I have in mind, so I'm taking the plunge and posting. My request:
On the website www.4-traders.com there's an input box located at the top center of the page for entering a company name or stock ticker symbol. The page contains code that calls a javascript function as one types into the input box. The javascript searches a database for the best matches to the text being input, and the output of the javascript function is presented as a floating list box that one can select from. The code for this component of the page is as follows:
<td class="recherche_bl">
<input type="hidden" name="lien" value="recherche">
<input onblur="GlobalSearch.ACblur();" onkeyup="GlobalSearch.ACkeyUp(event)" onkeydown="return GlobalSearch.ACkeyDown(event);" autocomplete="off" type="text" name="mots" id="autocomplete" class="inputrecherche" value="Symbol or Keyword(s)" onclick="document.recherche_menu.mots.value='';GlobalSearch.LoadHisto()">
<input type="image" src="/images/loupe_recherche.png" class="htZo" align="absmiddle" onclick="document.getElementById('noredirect').value='1'">
<input type="hidden" name="RewriteLast" value="zbat">
<input type="hidden" id="noredirect" name="noredirect" value="0">
<input type="hidden" id="type_recherche" name="type_recherche" value="0">
</td>
GlobalSearch is the javascript function I'm interested in. I'd like to get Excel VBA to somehow select from the output of the GlobalSearch function after a value is input into the form. I currently have to use sendkeys to accomplish this, which as everyone knows has a number of drawbacks and requires that an Internet Explorer windows is open at the time. Here is the code I'm currently using for this piece:
The value of Ticker is set before this part of the code.
.document refers to an Internetexplorer.Application object I have created earlier on in the code.
PauseTime is a procedure used to delay the execution of code.
The two lines involving sending a 'space' and 'backspace' key are used to get the javascript to run (it doesn't seem to run without some manual user input). Once the javascript runs I want the procedure to select the first instance in the list box, so I send a 'down' key and then an 'enter' key.
.document.recherche_menu.mots.Focus
.document.forms("recherche_menu")("mots").Value = Ticker
PauseTime (2)
Application.SendKeys (" ")
Application.SendKeys ("{BS}")
PauseTime (2)
Application.SendKeys ("{DOWN}")
Application.SendKeys ("~")
I would really appreciate some help to figure this out. I think the real issue is that I don't have a deep enough understanding of javascript to code what I need to into Excel VBA. Thanks in advance for your help.
Constantine
When a new user comes to the page and types in an email that already exists in the system, I would like to do the following:
Show the error message.
Show the arrow.
Then move the focus(cursor)
to the Password field.
Using jQuery I'm able to move the focus to the password field, but after a few milliseconds, the focus is pulled back to the email field with the Parsley error message.
I have tried using data-parsley-focus="..." and data-parsley-no-focus, but that didn't do anything for me. I've also looked at the source code and I see that validate.focusedField.focus() is what's forcing the focus back to the field with the error, but can't quite figure out how to stop that.
So, is there a way to override this behavior?
The following code works as expected, although you might need to tweak some aspects based on your code.
What I did:
Whenever a field has an error, check if it's a specific field (field1 in my case) and, if so, do something (in this case, focus on field2 input).
Add data-parsley-focus="none" to the form to avoid auto focus on the first input with errors (behaviour by default).
$(document).ready(function() {
$.listen('parsley:field:error', function(parsleyField) {
if (parsleyField.$element.attr('name') === 'field1') {
$("input[name=field2]").focus();
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/parsley.js/2.0.7/parsley.min.js"></script>
<form id="myForm" data-parsley-validate data-parsley-focus="none">
<input type="text" name="field1" required data-parsley-minlength="50" data-parsley-trigger="focusout" />
<input type="text" name="field2" required />
<input type="submit" />
</form>
If you run into some trouble, please provide a fiddle and add the relevant code to your question.
Trying to do the following, created this simple form for for a test:
<form name="input" action"submit.jsp" method="get">
Change background-color: #<input type="text"> <input type="submit"value="submit">
</form>
I am trying to, on clicking the button to take the value from the text box and insert that into a link (which is going to be a rest request) and action it.
I of course need to make sure no one can see the user and password I will pass along the request as well, can someone point me in the right direction of where to start?
I was thinking maybe to use
document.getElementById("id")
And have the input as:
<input name="bgcolor" id="bgcolor">
I'm just not sure how to execute and hide a rest request with a password inside.
To get
Thanks!
Can be completed using the following:
http://www.tizag.com/javascriptT/javascript-getelementbyid.php