input

Trying to return input from a function in C.

#include <stdio.h> #include <stdlib.h> #include <time.h> void initDeck (int deck[]); void showDeck (int deck[]); void shuffleDeck (int deck[]); int getBet (); main() { int deck[52]; int playerBet; char z; initDeck(deck); shuffleDeck(deck); showDeck(deck); playerBet = getBet(); //scanf ("%d\n", &playe...

Width of input type=text element

How come when I do this: <input type="text" style="width: 10px; padding: 2px"/> <div style="width: 10px; border: solid 1px black; padding: 2px">&nbsp;</div> the input ends up 2 px wider than the div in both IE6 and FF3? What am I missing? EDIT: As many people have said, the border is the issue. If I set border: 0px on the input, it w...

Date/Time input for an HTML Form

I'm having trouble finding an elegant way to allow for date/time input in an html form. I am thinking of having drop down menus for year, month, day, hour, minute, second, millisecond that are populated with valid entries only. I could do this by hard coding values for each drop down menu, but I'm thinking there must be a more elegant wa...

Using <input type="file"> with a FTP value

Is it possible to get access to a file on my FTP doing the following? <input type="file" name="final" id="final" value="http://www.blah.com.au/artwork/&lt;?=$OrderID?&gt;/&lt;?=$ItemID?&gt;/Final/Final.pdf"&gt;; I know that this specifically didn't work for me, but is there a way to get the file from the FTP so I can send the informat...

How to avoid navigate back when the user types backspace on a HTML text input?

Backspace is the browser hotkey for Navigate Back To The Last Page. I know that when an input has the focus this hotkey is disabled. But I have keyup and keydown events binded to this input, and something I wrote is causing this trouble. Do you know the solution? ...

SCHEME: how to input html and output it as html source?

Hi, I am trying to write a simple web app in scheme and I am using Drscheme for the job. I am wondering if there is a way to input html code into a form which then outputs it in html format (into source)? Is there a library that does the job? Everytime I input something it turns out as a string, I need it to be read as html. Can someone ...

jQuery dynamic creation of input fields based on the number selected in a dropdown menu?

I am trying to accomplish something along the lines of this: http://devblog.jasonhuck.com/assets/infiniteformrows.html But... I want to display a dropdown select field, with values 1 to 20, and depending on which value gets selected in that field that's how many input fields I will display to a user to fill out on the page (without ref...

Put A String In A ifstream Method

Hello, I'm learning C++ and i'm getting some troubles when i'm trying to use a String in a ifstream method, like this: string filename; cout << "Enter the name of the file: "; cin >> filename; ifstream file ( filename ); Here is the full code: // obtaining file size #include <iostream> #include <fstream> using namespace std; int...

Jquery: set style part of text in input text

Guys, I want to create some text based on user input, and when user enter some text, the first word will automatically set backgroundcolor, but the other words still remain same (no background color), can I do this ? Thanks ...

css: Problem with width and padding in IE

I'm having a problem with widths on input[text] fields in IE, all versions. I have a div with an explicitly set width of 250px. In this div, I have an input text field with width set to 100%. This input also has an internal left-padding of 10px. In IE, it renders the width as 100% + 10px. I cannot figure out a technique for constraini...

Where do I start making a linux input hack?

When you hold "shift" and scroll with your mouse on a mac, it interprets your vertical scroll motion into horizontal scroll actions. This is my most missed feature when working on linux, and I would love to bring it to linux (since I have looked thoroughly and nobody else seems to have done so yet). I hope this can be done with some sor...

Curses getting arrow keys

In trying to get input from the arrow keys via curses (ncurses) it won't catch as KEY_UP etc. I used the keypad function with a true argument but getch still returns an escaped sequence. How do I sift through the values returned by getch() and grab the arrow keys specifically? ...

Getting Form Input with Javascript or jQuery for Background Color Manipulation

How can I get form inputs real time and use them to change the background color of elements? I have an input field that will accept six digit hex values: <input name="acct-bcolor" id="acct-bcolor" class="color" value="141414"> Thanks in advance. -B ...

JavaScript: Mousewheel event doesn't fire while over textbox.

I need some help. I am trying to bind to the mousewheel event from JavaScript and I've successfully done that. But something doesn't work quite as I expected. When I am over an input the event doesn't fire. I have tried to bind to the input's event for the mousewheel but the same thing happens, the event doesn't fire. ...

Should I use ondeactivate or onblur when leaving a input textbox?

I have some HTML inputs and I need to run some javascript when the user exits them however I have always used onblur but a colleague has suggested ondeactivate. I can't find much info about ondeactivate and thought it was an old method for old browsers. Will onblur run on older browsers? ...

Javascript question: How do I duplicate user input into a hidden field?

How can I pass input from a text-type input element into a hidden input element in the same form on a site that has jquery installed? ...

Input Form Selectable Images

I am looking to create an option within a form to choose a theme for the page. The options need to be displayed as images so the user can see what the theme looks like. What is my best way to implement this? ...

Vertically aligning the text cursor (caret?) in an input box with jQuery, Javascript or CSS.

Hey all, I'm messing with the CSS on an input box in CSS, to make the text bigger, adding a border, changing color, etc. I've aligned the bigger text to fit nicely (vertically-aligned) within my input box using padding, but the little blinking text cursor is terribly aligned (hugs the bottom). I'm wondering if there is a way to adjust...

Making a Javascript array of multiple CSS classes assigned to an element with jQuery

MY javascript: Updated Again. $('.calc').change(function(){ var classArray = $(this).attr('class').split(','); $.each(classArray, function(){ alert(classArray); }); }); And the input: <input type="text" class="calc R#r# C#i#" /> The pound signs are variables, I'm using ColdFusion. What I need to be able to do ...

Blocking spam in a PHP site without bothering the user.

I'm currently working on a little chat/forum site that I roughed out in a weekend, and it has anonymous entries (i.e.: no usernames or passwords). This looks like it could be easy-cake for a spammer to ruin, but I don't want to bother the user with captchas or similar anti-spam inputs. Are there any invisible-to-the-user alternatives t...