English 中文(简体)
打开我联系的方框
原标题:textbox opening my link using if else statement javascript
  • 时间:2012-05-02 05:35:32
  •  标签:
  • javascript

i want意相同,但在其他方面,它将打开我其他档案的链接。 整个法典是罚款的,但是如果在案文中加入某种内容,则希望在警示或主窗上出现联系。

<script Language="JavaScript">
<!--
    function Blank_TextField_Validator() {
        // Check the value of the element named text_name from the form named text_form
        if (text_form.text_name.value == "") {
            // If null display and alert box
            alert("Please fill in the text field.");
            // Place the cursor on the field for revision
            text_form.text_name.focus();
            // return false to stop further processing
            return (false);
        }
        // If text_name is not null continue processing
        return (true);
    }
-->
</script>
<form name="text_form" method="get" action="#" onsubmit="return Blank_TextField_Validator()">
    <input type="text" name="text_name" >
    <input type="submit" value="Submit">
</form>​​​
问题回答

但在其他方面,它将打开我其他档案的链接。

“如果是,”你指的是在表格提交回报时打开链接? 如果是的话,仅以<条码>><>>>> 代码/代码”的形式将这一链接归于<条码>#<>。

but when i enter something in the textfeild i want a link to appear either in the alert or on the main window.

如果你想显示链接,请在<代码>后(www.example.com);。 如果案文_名称不作废,继续处理。


EDIT

我调整了你的联合材料功能:

<script Language="JavaScript">
<!--
function Blank_TextField_Validator() {
    // Check the value of the element named text_name from the form named text_form
    if (text_form.text_name.value == "") {
        // If null display and alert box
        alert("Please fill in the text field.");
        // Place the cursor on the field for revision
        text_form.text_name.focus();
        // return false to stop further processing
        return (false);
    }
    // If text_name is not null continue processing
    if (text_form.text_name.value == "project")
        window.open( project.htm );
    else if (text_form.text_name.value == "under")
        window.open( underconstruction.htm );
    else
        alert("Invalid keyword!");
    return (true);
}
-->
</script>




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签